Date.Year

Updated on

Date.Year is a Power Query M function that returns the year component of the provided date(time) value.

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

Syntax

Date.Year( dateTime as any ) as nullable number

Description

Date.Year extracts the year component from a provided dateTime (date, datetime, or datetimezone).

Examples

Find the year in #datetime( 2011, 12, 31, 9, 15, 36 ).

// Output: 2011
Date.Year( #datetime( 2011, 12, 31, 9, 15, 36 ) )

Learn more about Date.Year in the following articles:

Other functions related to Date.Year are:

BI Gorilla Blog

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