Date.IsLeapYear

Updated on

Date.IsLeapYear is a Power Query M function that indicates whether the given date(time) value falls in a leap year. The function returns a boolean value (true or false).

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Date.IsLeapYear( dateTime as any ) as nullable logical

Description

Date.IsLeapYear identifies if the year of a given dateTime parameter (of type date, datetime, or datetimezone) is a leap year.

Examples

Determine if the year 2012, as represented by #date( 2012, 01, 01 ) is a leap year.

// Output: true
Date.IsLeapYear( #date( 2012, 01, 01 ) )

Other functions related to Date.IsLeapYear are:

BI Gorilla Youtube Channel

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-isleapyear