<!-- https://learnsql.cpetoday.com/functions/m/date-startofweek -->
# Date.StartOfWeek

Language: Power Query M
Category: Date
Syntax: Date.StartOfWeek(dateTime as any, optional firstDayOfWeek as nullable Day.Type) as date
Summary: Returns the first day of the week that contains a date, using the day you name as the first day of the week.
Returns: The start of the week as a date, or null when the input is null.
Level: Beginner
Related: Date.DayOfWeek, Date.WeekOfYear, Date.EndOfMonth, Date.AddWeeks, Date.AddDays

## What it does
Date.StartOfWeek moves a date back to the first day of its week. The week starts on Sunday by default. Pass Day.Monday when the business counts weeks from Monday. Weekly cash, sales and labor reports group by this date, and it is the most readable week label.
## Syntax and arguments
- dateTime: a date or a datetime value.
- firstDayOfWeek (optional): the day that starts the week, such as Day.Monday. The default is Day.Sunday.
## Example
A weekly cash report groups daily bank activity by the Monday that starts each week. The report then shows one row per week.

```powerquery
let
    Cash = #table(type table [CashDate = date, Net = number],
        {{#date(2026, 10, 26), 1000}, {#date(2026, 10, 30), -400}, {#date(2026, 11, 2), 250}}),
    Week = Table.AddColumn(Cash, "WeekStarting", each Date.StartOfWeek([CashDate], Day.Monday), type date),
    Weekly = Table.Group(Week, {"WeekStarting"}, {{"NetCash", each List.Sum([Net]), type number}})
in
    Weekly
```

October 26 and October 30 fall in the week starting Monday, October 26, so their net is 600. November 2 starts its own week. The weekly net cash figures are 600 and 250.
## Example: a second, different use
Find the first day of the week for a delivery date when the supplier's week starts on Sunday, using the default argument.
## Things to watch
- The default is Sunday. Pass Day.Monday when the business week starts on Monday, or the groups will be off by a day.
- The time part is removed for a datetime input.
- Use the start date as the week label rather than a week number, which can differ by system.
- Null in gives null out.
## In business terms
Weekly reporting is common in retail, services and cash management. A week start date on each row is a clear, unambiguous label that the whole team can read, and it matches how the business defines its week.
