Quarter to date (QTD) and week to date (WTD) work like YTD with a different start: the first day of the quarter or of the week. Quarters are unambiguous. Weeks depend on the day they start, which in QuickSight is Sunday unless the analysis says otherwise.
Copy and paste
QTD and WTD up to now:
periodToDateSum({Sales}, {Order Date}, QUARTER)
periodToDateSum({Sales}, {Order Date}, WEEK)
QTD up to a reference date (Datetime parameter AsOfDate):
sumIf({Sales}, {Order Date} >= truncDate('Q', ${AsOfDate})
AND {Order Date} < addDateTime(1, 'DD', ${AsOfDate}))
WTD with weeks starting on Monday, whatever the settings:
sumIf({Sales},
{Order Date} >= addDateTime(-1 * mod(extract('WD', ${AsOfDate}) + 5, 7), 'DD', truncDate('DD', ${AsOfDate}))
AND {Order Date} < addDateTime(1, 'DD', ${AsOfDate}))
Example
Orders around the week of Friday 15 May 2026, the reference date:
| Order Date | Weekday | Sales |
|---|---|---|
| 2026-04-08 | Wednesday | 80 |
| 2026-05-02 | Saturday | 120 |
| 2026-05-09 | Saturday | 70 |
| 2026-05-10 | Sunday | 40 |
| 2026-05-11 | Monday | 90 |
| 2026-05-13 | Wednesday | 60 |
| 2026-05-15 | Friday | 50 |
| 2026-05-16 | Saturday | 80 |
| Measure | From | To | Sales |
|---|---|---|---|
| QTD | 2026-04-01 | 2026-05-15 | 510 |
| WTD, week starting Sunday | 2026-05-10 | 2026-05-15 | 240 |
| WTD, week starting Monday | 2026-05-11 | 2026-05-15 | 200 |
The 40 sold on Sunday 10 May is the whole difference between the two weeks.
The week start
AWS documents Sunday as the start of the week, and an analysis setting to change it: Edit → Analysis settings → Date and time → Custom start day. Week-level fields, filters and calculated fields of that analysis follow the setting, and so does every dashboard published from it.
periodToDateSum(..., WEEK) is the short way when the analysis setting matches your business. When
weeks must start on Monday in every analysis, for example to match ISO weeks in the warehouse, use the
sumIf version: it computes Monday from the weekday number. The arithmetic is explained in
how to calculate the first day of the week.
Bounds
The sumIf versions end before the day after the reference date, so a timestamp at 18:00 on 15 May is
included. They also stop at the reference date when the table holds later rows, such as the Saturday
order here.
Related guides
Checked against the Amazon Quick Sight documentation (October 2026). The example results were recomputed in DuckDB.