Date.EndOfWeek
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Returns a date, datetime, or datetimezone value for the end of the week.
Date.StartOfWeek(dateTime as any, optional firstDayOfWeek as nullable number) as any
| Argument | Description |
|---|---|
| dateTime | The date, datetime, or datetimezone to check against. |
| optional firstDayOfWeek | A number value as an enum value to set the last day of the week. The default value for firstDayOfWeek is Day.Sunday. |
Day Enum Values
Day.Sunday = 0;
Day.Monday = 1;
Day.Tuesday = 2;
Day.Wednesday = 3;
Day.Thursday= 4;
Day.Friday = 5;
Day.Saturday= 6;
The date and time portions are reset to their initial values for the week.
The timezone information is persisted.
let dateTime = DateTimeZone.FromText("2011-02-24T12:30:00-08:00") in
Date.EndOfWeek(dateTime, Day.Sunday) equals 2011-02-26T23:59:59.9999999-08:00
Show: