OpenBI Docs Buy

MONTH

Which month a date falls in, counted from January as 1.

Group: Date and time. Compatible with DAX.

Syntax

MONTH ( <datetime> )
ParameterTypeDescription
datetimeDateA date, a date with a time, or text that reads as one.

Returns

Whole number. Where the date's month comes in the year: January is 1, December 12.

Remarks

  • A blank date gives BLANK.
  • Text is read as a date first; a number is taken as a date number.
  • For the month's name rather than its number, use FORMAT ( date, "mmmm" ).

Examples

The month of a date

EVALUATE
ROW ( "Month", MONTH ( DATE ( 2024, 3, 15 ) ), "Of a date number", MONTH ( 45000.75 ) )
MonthOf a date number
33

Decembers in the sales

Sales run from November 2023 to October 2026: three of their months are Decembers.

EVALUATE
ROW (
    "Decembers",
        COUNTROWS ( FILTER ( VALUES ( Sales[Month] ), MONTH ( Sales[Month] ) = 12 ) )
)
Decembers
3

YEAR, DAY, QUARTER, EOMONTH, FORMAT.

Last updated · OpenBI Studio 0.3.74