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
Returns the year component of the provided datetime
value, dateTime
.
Examples
Find the year in #datetime( 2011, 12, 31, 9, 15, 36 ).
// Output: 2011
Date.Year( #datetime( 2011, 12, 31, 9, 15, 36 ) )
Related articles
Learn more about Date.Year 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
Related functions
Other functions related to Date.Year are:
- Date.Day
- Date.DayOfWeek
- Date.DayOfYear
- Date.DaysInMonth
- Date.Month
- Date.QuarterOfYear
- Date.WeekOfMonth
- Date.WeekOfYear
