Date.EndOfYear is a Power Query M function that returns the end of the year, including fractional seconds and preserving time zone information. The function returns the end of the year as a date, datetime, or datetimezone value.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Date.EndOfYear( dateTime as any ) as any
Description
Returns the end of the year that contains dateTime
, including fractional seconds. Time zone information is preserved.
dateTime
: Adate
,datetime
, ordatetimezone
value from which the end of the year is calculated.
Examples
Get the end of the year for 5/14/2011 05:00:00 PM.
// Output: #datetime( 2011, 12, 31, 23, 59, 59.9999999 )
Date.EndOfYear( #datetime( 2011, 5, 14, 17, 0, 0 ) )
Get the end of hour for 5/17/2011 05:00:00 PM -7:00.
// Output: #datetimezone( 2011, 12, 31, 23, 59, 59.9999999, -7, 0 )
Date.EndOfYear( #datetimezone( 2011, 5, 17, 5, 0, 0, -7, 0 ) )
Related articles
Learn more about Date.EndOfYear 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.EndOfYear are:
