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

Language: Power Query M
Category: Date
Syntax: Date.StartOfQuarter(dateTime as any) as date
Summary: Returns the first day of the calendar quarter that contains a date.
Returns: The first day of the quarter as a date, or null when the input is null.
Level: Beginner
Related: Date.EndOfQuarter, Date.QuarterOfYear, Date.StartOfMonth, Date.StartOfYear, Date.AddMonths

## What it does
Date.StartOfQuarter returns the first day of the quarter that holds a date. January 1, April 1, July 1 or October 1 is the result, depending on the quarter. It is the start of a quarter to date range, and it sets the period start for quarterly accruals.
## Syntax and arguments
- dateTime: a date or a datetime value.
## Example
A quarter to date report sums sales from the start of the quarter to the report date. The start of the quarter is calculated from the report date.

```powerquery
let
    ReportDate = #date(2026, 10, 29),
    QuarterStart = Date.StartOfQuarter(ReportDate),
    QuarterEnd = Date.EndOfQuarter(ReportDate),
    Days = Duration.Days(ReportDate - QuarterStart)
in
    {QuarterStart, QuarterEnd, Days}
```

The quarter starts on October 1, 2026 and ends on December 31, 2026. October 29 is 28 days after the quarter started, so Days is 28. The quarter to date range is every date from QuarterStart to ReportDate.
## Example: a second, different use
Group a list of postings into quarters by using the quarter start as the group key, which keeps the quarters in order.
## Things to watch
- The start is always the first day of a calendar quarter, not of a fiscal quarter.
- A datetime input gives a date result, so the time part is dropped.
- Day counts from a start use Duration.Days, not a plain subtraction.
- Null in gives null out.
## In business terms
Quarter to date sales, quarterly accruals and the quarterly close all start from the quarter's first day. Having that date on every row keeps a year to date and a quarter to date view consistent.
