Date.EndOfYear

This function retrieves the end of the year that corresponds to the provided dateTime, including fractional seconds. The time zone information associated with the dateTime is maintained. The input sho...

Syntax

Date.EndOfYear(dateTime as any) as any

About

This function retrieves the end of the year that corresponds to the provided dateTime, including fractional seconds. The time zone information associated with the dateTime is maintained. The input should be a date, datetime, or datetimezone value used to calculate the end of the year.

Explanation

Retrieve the end of the year for May 14, 2011, at 5:00:00 PM using Power Query MDate.EndOfYear function with the input of #datetime(2011, 5, 14, 17, 0, 0). The output will be #datetime(2011, 12, 31, 23, 59, 59.9999999). Retrieve the end of the hour for May 17, 2011, at 5:00:00 PM with a time zone offset of -7:00 using Power Query MDate.EndOfYear function and input #datetimezone(2011, 5, 17, 5, 0, 0, -7, 0). The output will be #datetimezone(2011, 12, 31, 23, 59, 59.9999999, -7, 0).