MONTH Function (DAX)

How does the MONTH function (DAX) work?

MONTH function returns the month from 1 (January) to 12 (December) as number.

MONTH Formula Syntax

= MONTH(
     <datetime>
)

How do you use the MONTH function?

Unlike Microsoft Excel, which stores the dates as serial numbers, while working with dates, DAX uses a datetime format. The date used as an argument to the MONTH function can be entered by typing an accepted datetime format, by providing a reference to a column containing dates, or by using an expression returning a date.

Related Blog Posts

Related Support Forum Posts

Calculating Month On Month Change – Custom (445) Calendars, Power BI & DAX
Cumulative Year To Date & Monthly Average Year To Date

Dynamic Grouping – Last Month Value

Considerations when using the MONTH function

When the date argument is a text representation of the date, the function uses the client computer’s locale and date time settings to understand the text value for the conversion. If the current date time settings represent a date in the format of Month/Day/Year, then the following string “1/8/2009” is interpreted as a datetime value equivalent to January 8th of 2009, and the function yields a result of 1. However, if the current date time settings represent a date in the format of Day/Month/Year, then the same string would be interpreted as a datetime value equivalent to August 1st of 2009, and the function yields a result of 8.

If the date’s text representation can not be translated to a datetime value correctly, then the function returns an error.

Related Video Tutorials

Formula examples using the MONTH function

Example 1

The following expression returns 3, which is the integer corresponding to March, the month in the date argument.

= MONTH (
    “March 3, 2008 3:45 PM”
)

Example 2

The following expression returns the month from the date in the TransactionDate column of the Orders table.

= MONTH (
    Orders[TransactionDate]
)

Related DAX Functions

HOUR
MINUTE

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.