OpenBI Docs Buy

QUARTER

The quarter of a date, 1 to 4.

Group: Date and time. Compatible with DAX.

Syntax

QUARTER ( <date> )
ParameterTypeDescription
dateDateA date, a date with a time, or text that reads as one.

Returns

Whole number. The quarter of the year, 1 to 4: January to March is 1.

Remarks

  • A blank date gives BLANK.
  • It is the calendar quarter. For a financial year that starts in another month, shift the date first, as QUARTER ( EDATE ( date, -6 ) ) for a year that starts in July.
  • For a label such as Q1, join it to text: "Q" & QUARTER ( date ).

Examples

Either side of a quarter's end

EVALUATE
ROW (
    "31 March", QUARTER ( DATE ( 2024, 3, 31 ) ),
    "1 April", QUARTER ( DATE ( 2024, 4, 1 ) )
)
31 March1 April
12

Sales months by year and quarter

Sales start in November 2023 and end in October 2026, so the first and last quarters are short.

EVALUATE
GROUPBY (
    ADDCOLUMNS (
        VALUES ( Sales[Month] ),
        "Year", YEAR ( Sales[Month] ),
        "Quarter", QUARTER ( Sales[Month] )
    ),
    [Year],
    [Quarter],
    "Months", COUNTX ( CURRENTGROUP (), 1 )
)
ORDER BY [Year], [Quarter]
YearQuarterMonths
202342
202413
202423
202433
202443
202513
202523
202533
202543
202613
202623
202633
202641

MONTH, YEAR, EDATE, STARTOFQUARTER.

Last updated · OpenBI Studio 0.3.74