<!-- https://learnsql.cpetoday.com/functions/dax/datesqtd -->
# DATESQTD

Language: DAX
Category: Time intelligence: to date
Syntax: DATESQTD(<dates>)
Summary: Returns a table of dates from the start of the calendar quarter up to the last date in the filter context.
Returns: A table of dates, used as a filter inside CALCULATE.
Level: Intermediate
Related: TOTALQTD, DATESYTD, DATESMTD, CALCULATE, STARTOFQUARTER

## What it does
DATESQTD returns the dates from the start of the current calendar quarter to the last date in the context. CALCULATE uses those dates as a filter, so any measure can be shown quarter to date. Use it when TOTALQTD is not flexible enough, for example when another filter or a shifted period is needed.

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

## Example
A collections team tracks cash received quarter to date. In a view for November 2026, the filter covers October 1 through the last date in the context.

```dax
Cash Received QTD =
CALCULATE(
    SUM('Payments'[Amount]),
    DATESQTD('Calendar'[Date])
)
```

The total starts on October 1, because October begins the fourth calendar quarter. It resets to zero at the start of January.

## Example: a second, different use
The same quarter-to-date days in the prior quarter. DATESQTD gives the current days, and DATEADD moves them back one quarter, so the comparison is like for like.

```dax
Revenue QTD Prior Quarter =
CALCULATE(
    [Total Revenue],
    DATEADD(DATESQTD('Calendar'[Date]), -1, QUARTER)
)
```

When the quarter-to-date days run from October 1 to November 15, the prior-quarter figure covers July 1 to August 15 of the same year.

## Things to watch
- DATESQTD uses calendar quarters. A fiscal quarter needs a filter built from the Calendar's fiscal columns.
- It returns a table, so use it inside CALCULATE or as the table for an iterator.
- The Calendar date column must be used, and the Calendar must be complete.
- A partial quarter is compared with the same days of the prior quarter, not with the full prior quarter. This is the fair comparison in an open quarter.

## In business terms
DATESQTD underpins quarter-to-date bookings, cash collections, expense tracking and the quarter-end forecast. It helps a controller or sales leader judge the quarter before it closes.
