Date.DaysInMonth

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

Syntax

Date.DaysInMonth( dateTime as any ) as nullable number

Description

Returns the number of days in the month in the date, datetime, or datetimezone value dateTime.

  • dateTime: A date, datetime, or datetimezone value for which the number of days in the month is returned.

Examples

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

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-daysinmonth
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.