Date.DaysInMonth is a Power Query M function that returns the number of days in the month in the date, datetime, or datetimezone value. The function returns the number of days in the month as an integer.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Date.DaysInMonth( dateTime as any ) as nullable number
Returns the number of days in the month in the
datetimezonevalue for which the number of days in the month is returned.
Number of days in the month December as represented by
#date( 2011, 12, 01 )>.
// Output: 31 Date.DaysInMonth( #date( 2011, 12, 01 ) )
Learn more about Date.DaysInMonth in the following articles:
- Create Date Table or Calendar in Power Query M
Learn how to create a dynamic calendar table in Power Query’s M language. Build your custom columns and claim your free Date Table Script. » Read more
Other functions related to Date.DaysInMonth are: