MONTH DAX Function (Date and Time)
Returns a number from 1 (January) to 12 (December) representing the month.
Syntax
Parameter | Attributes | Description |
---|---|---|
Date |
A date in datetime format. |
Return values
An integer number indicating the number of the month.
Remarks
If the argument is a string, it is translated into a datetime value using the same rules applied by the DATEVALUE function.
» 4 related functions
Examples
-- Extract date parts from a date EVALUATE ADDCOLUMNS ( TOPN ( 10, VALUES ( 'Date'[Date] ), 'Date'[Date], ASC ), "Year", YEAR ( 'Date'[Date] ), "Quarter", QUARTER ( 'Date'[Date] ), "Month", MONTH ( 'Date'[Date] ), "Day", DAY ( 'Date'[Date] ) ) ORDER BY 'Date'[Date]
Date | Year | Quarter | Month | Day |
---|---|---|---|---|
2005-01-01 | 2,005 | 1 | 1 | 1 |
2005-01-02 | 2,005 | 1 | 1 | 2 |
2005-01-03 | 2,005 | 1 | 1 | 3 |
2005-01-04 | 2,005 | 1 | 1 | 4 |
2005-01-05 | 2,005 | 1 | 1 | 5 |
2005-01-06 | 2,005 | 1 | 1 | 6 |
2005-01-07 | 2,005 | 1 | 1 | 7 |
2005-01-08 | 2,005 | 1 | 1 | 8 |
2005-01-09 | 2,005 | 1 | 1 | 9 |
2005-01-10 | 2,005 | 1 | 1 | 10 |
Related articles
Learn more about MONTH in the following articles:
-
Correct calculate of age in DAX from birthday
By answering to a student question I realized we often used a wrong calculation of customers age in DAX, and the simple solution is to borrow the same technique used in Excel, using INT and YEARFRAC rather than DATEDIFF or other divisions by 365 or 365.25. » Read more
-
Computing MTD, QTD, YTD in Power BI for the current period
This article describes how to use the DAX time intelligence calculations applied to the latest period available in the data, also known as the “current” period. » Read more
Related functions
Other related functions are:
Last update: Nov 14, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/month-function-dax