<!-- https://learnsql.cpetoday.com/functions/dax/startofquarter -->
# STARTOFQUARTER

Language: DAX
Category: Time intelligence: first and last
Syntax: STARTOFQUARTER(<dates>)
Summary: Returns the first date of the calendar quarter that contains the dates in the filter context, as a one-row table.
Returns: A table with one date, used as a filter inside CALCULATE.
Level: Intermediate
Related: ENDOFQUARTER, STARTOFMONTH, STARTOFYEAR, DATESQTD, FIRSTDATE

## What it does
STARTOFQUARTER returns the first day of the quarter in context. Inside CALCULATE it limits the measure to that day, which is useful for a balance at the start of the quarter. Finance teams use it for the quarter opening position of deferred revenue, receivables and accruals, and for the quarter start date in a roll-forward.

## Syntax and arguments
- dates: the date column of the Calendar table. Required.

## Example
A subscription company tracks deferred revenue on the first day of each quarter, for the quarterly roll-forward.

```dax
Deferred Revenue Start of Quarter =
CALCULATE(
    SUM('Deferred_Revenue'[Balance]),
    STARTOFQUARTER('Calendar'[Date])
)
```

In a Q4 2026 row, the filter is October 1, 2026. The measure returns the deferred revenue balance on that day.

## Example: a second, different use
The quarter start date as a label for a quarterly table, so each row shows the date the quarter begins.

```dax
Quarter Start Date = CALCULATE(MIN('Calendar'[Date]), STARTOFQUARTER('Calendar'[Date]))
```

## Things to watch
- The function uses calendar quarters. For a fiscal quarter, use a filter on the fiscal columns of the Calendar.
- It returns one day. Use DATESQTD or TOTALQTD when a total from the start of the quarter is needed.
- The first day of the quarter must have a snapshot row, or the balance is blank.
- Keep it inside CALCULATE. On its own, it is not a number.

## In business terms
STARTOFQUARTER supports the quarter-start balance for the roll-forward of deferred revenue, accruals and receivables. It is the tool used to show that a balance carried from the prior quarter's close.
