Dashboard Mode - DATESYTD and cumulative totals
Dashboard Goal
Understand how sales accumulate over the year up to each date using the DATESYTD function and show cumulative totals.
Understand how sales accumulate over the year up to each date using the DATESYTD function and show cumulative totals.
| Date | Sales |
|---|---|
| 2024-01-05 | 100 |
| 2024-02-10 | 200 |
| 2024-03-15 | 150 |
| 2024-04-20 | 300 |
| 2024-05-25 | 250 |
| 2024-06-30 | 400 |
| 2024-07-10 | 350 |
Total Sales YTD = CALCULATE(SUM(Sales[Sales]), DATESYTD(Sales[Date]))Cumulative Sales = CALCULATE(SUM(Sales[Sales]), FILTER(ALL(Sales[Date]), Sales[Date] <= MAX(Sales[Date])))+----------------------+-------------------------+ | Total Sales YTD | Cumulative Sales Chart | | (KPI Card) | (Line Chart) | +----------------------+-------------------------+ | Sales by Date with Cumulative Total Table | +--------------------------------------------------------------+
A date slicer allows selecting a date range. When the user changes the date range, the KPI card, line chart, and table update to show sales and cumulative totals only for the selected dates within the year.
If you add a filter to show only sales up to 2024-04-20, what is the Total Sales YTD value?
Answer: Sum sales from 2024-01-05 to 2024-04-20 = 100 + 200 + 150 + 300 = 750