Редагувати

Поділитися через


QUARTER

Applies to: Calculated column Calculated table Measure Visual calculation

Returns the quarter as a number from 1 (January – March) to 4 (October – December).

Syntax

QUARTER(<date>)

Parameters

Term Definition
date A date.

Return value

An integer number from 1 to 4.

Remarks

If the input value is BLANK, the output value is also BLANK.

Example 1

The following DAX query:

EVALUATE { QUARTER(DATE(2019, 2, 1)), QUARTER(DATE(2018, 12, 31)) } 

Returns:

[Value]
1
4

Example 2

The following DAX query:

EVALUATE
ADDCOLUMNS(
    FILTER(
        VALUES(
            FactInternetSales[OrderDate]), 
            [OrderDate] >= DATE(2008, 3, 31) && [OrderDate] <= DATE(2008, 4, 1)
        ), 
    "Quarter", QUARTER([OrderDate])
)

Returns:

FactInternetSales[OrderDate] [Quarter]
3/31/2008 1
4/1/2008 2

YEAR
MONTH
DAY