Quarter-to-date with CALCULATE and DATESQTD
See what TOTALYTD does under the hood, and use the same pattern for a quarter-to-date total.
You will learn to
- Explain that DATESYTD returns a table of dates
- Use a date table as a CALCULATE filter
- Build a quarter-to-date measure
How it works
`TOTALYTD` is a shortcut. Underneath, `DATESYTD('Date'[Date])` returns a **table of dates**: every day from 1 January up to the last visible date. Hand that table to `CALCULATE` as a filter, and the measure is evaluated over exactly those days.
So `CALCULATE([Total Sales], DATESYTD('Date'[Date]))` and `TOTALYTD([Total Sales], 'Date'[Date])` give the same numbers. The CALCULATE form is worth knowing because you can add more filters next to the dates.
The same family covers other periods: `DATESQTD` starts at the beginning of the quarter, `DATESMTD` at the beginning of the month. Because the Date table is marked, a filter on `'Date'[Date]` replaces the row’s month filter rather than fighting it.
Practice it hands-on with a real data model and a live report that updates as you type.
Sales YTD = CALCULATE([Total Sales], DATESYTD('Date'[Date]))