DAX Function Guide
MONTH
Sam McKay
CEO & Founder
How does the MONTH work?
MONTH Formula Syntax
= MONTH(
<datetime>
)
How do you use the MONTH?
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
Loading
Considerations when using the MONTH?
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
Loading
Formula examples using the MONTH
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 Courses
Loading