Updated on

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


Date.DaysInMonth calculates the number of days in the month of the given date, datetime, or datetimezone value (dateTime). It returns a number between 28 and 31, reflecting the month’s length in days.


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:

Other functions related to Date.DaysInMonth are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: