Date.EndOfWeek
This function returns the end of the week that includes the specified dateTime input. Optionally, you can specify a Day value, firstDayOfWeek, to determine which day is considered the first day of the...
This function returns the end of the week that includes the specified dateTime input. Optionally, you can specify a Day value, firstDayOfWeek, to determine which day is considered the first day of the week for this calculation. By default, the first day of the week is set to Sunday. dateTime: This should be a date, datetime, or datetimezone value that will be used to calculate the end of the week. firstDayOfWeek: [Optional] This is a Day.Type value that indicates which day is considered the first day of the week. The available options are Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday. The default value is Sunday.
Obtain the end of the week date for May 14, 2011.
Usage:
Power Query MDate.EndOfWeek(#date(2011, 5, 14))
Output:
#date(2011, 5, 14)
Obtain the end of the week date and time for May 17, 2011, at 5:00:00 PM with a time zone offset of -7:00, considering Sunday as the first day of the week.
Usage:
Power Query MDate.EndOfWeek(#datetimezone(2011, 5, 17, 5, 0, 0, -7, 0), Day.Sunday)
Output:
#datetimezone(2011, 5, 21, 23, 59, 59.9999999, -7, 0)