STARTOFQUARTER

The STARTOFQUARTER function returns the first day of the quarter in the current context (or the first day of the first quarter, if the current context includes more than one) for the specified date column.

Syntax

STARTOFQUARTER(
    dates
)

Parameters
  • dates: Column containing dates.
Returned value

The STARTOFQUARTER function returns a table with a single column and a single row with a date.

Additional Information

The dates argument can be a reference to a column containing dates, an expression that returns a table with a single column containing dates, or a Boolean expression that defines a table with a single column containing dates.

Examples

The beginning and end of the month, the quarter and the year are shown in the following table for some dates of May 2011:

STARTOF and ENDOF functions

If we bring the quarter number to the row headings in a matrix, the year to the column headings, and the following measure:

First day of quarter = STARTOFQUARTER(DimDate[Datekey])

...to the values field, we get the following result:

STARTOFQUARTER function. Example of use

It can be seen how the result of the measure coincides with the first day of the quarter.

If, in the same scenario as in the previous example, we take the month to the row headers, the result obtained is the following:

STARTOFQUARTER function. Example of use

We see how, in this case, the created measure returns the first day of the quarter involved in the context. That is, even if the month is February, the STARTOFQUARTER function will return January 1 for that context.

The same happens if we bring the number of the week to the row headers:

STARTOFQUARTER function. Example of use

We see how, again, the measure returns the first day of the quarter to which the week considered in the context belongs.

Category
Time intelligence
Submitted by admin on Tue, 12/04/2018 - 11:51