Visual Design: KPI Cards, Bar, Line & Combo Charts
Overview & Learning Objectives
Executives don't just monitor daily sales; they track cumulative progress toward annual targets: "How much revenue have we generated Year-to-Date?" DAX provides built-in cumulative functions: `TOTALYTD()` (Year-to-Date), `TOTALQTD()` (Quarter-to-Date), and `TOTALMTD()` (Month-to-Date). These functions accumulate metrics from the start of the period up to the current date, automatically resetting when crossing boundaries.
- Master the syntax and mechanics of `TOTALYTD()`, `TOTALQTD()`, and `TOTALMTD()`.
- Configure custom fiscal year-end dates (e.g. Indian Fiscal Year ending March 31).
- Explain the equivalence between `TOTALYTD` and `CALCULATE(..., DATESYTD(...))`.
Industry Standard
Standard: Analytics teams at Flipkart and Deloitte standardize on `CALCULATE([Sales], DATESYTD(Dim_Date[Date], "03-31"))` to support Indian fiscal reporting spanning April 1 to March 31.
Real-World Example: Burger Point Financial Accounting
Burger Point tracks monthly revenue and cumulative Year-to-Date revenue. Sales reset every year on January 1.
| Month | Monthly Sales (₹) | Calculated TOTALYTD Sales (₹) | Reset Behavior |
|---|---|---|---|
| January | 1,00,000 | 1,00,000 | Starts new cumulative year |
| February | 1,20,000 | 2,20,000 | Accumulates (100k + 120k) |
| March | 1,50,000 | 3,70,000 | Accumulates (220k + 150k) |
| January (Next Year) | 1,10,000 | 1,10,000 (Resets!) | Resets back to zero for new year |
Functions Covered in this Chapter
Here is the definition, exact syntax, parameter breakdown, and real-world business example for each function covered in this chapter:
TOTALYTD Function
Definition: Evaluates an expression cumulative over the year to date up to the latest date visible in the current filter context.
Sales YTD = TOTALYTD([Total Sales], Dim_Date[Date])
Expression: The measure to calculate cumulatively (e.g. `[Total Sales]`).Dates: The contiguous date column from a marked Date dimension table.Filter: Optional filter expression applied to the calculation.YearEndDate: Optional string for fiscal years (e.g. `"03-31"` for Indian fiscal year).
India Fiscal YTD = TOTALYTD([Total Sales], Dim_Date[Date], "03-31")TOTALQTD Function
Definition: Evaluates an expression cumulatively from the start of the active quarter to the current date.
Sales QTD = TOTALQTD([Total Sales], Dim_Date[Date])
Expression: The measure being accumulated quarterly.Dates: Contiguous date column from a marked Date table.
Quarterly Accumulation = TOTALQTD([Total Sales], Dim_Date[Date])TOTALMTD Function
Definition: Evaluates an expression cumulatively from day 1 of the current month up to the current date.
Sales MTD = TOTALMTD([Total Sales], Dim_Date[Date])
Expression: The measure being accumulated monthly.Dates: Contiguous date column from a marked Date table.
Orders MTD = TOTALMTD([Total Orders], Dim_Date[Date])Common Mistakes & Limitations
- Passing a Fact table date column into `TOTALYTD`, causing incomplete or erroneous accumulation.
- Forgetting that `TOTALYTD` continues accumulating into future blank dates if your date table extends beyond today.
Keyboard Shortcuts
| Action | Windows | Mac |
|---|---|---|
| Quick Measure: YTD Total | Quick Measure -> Time Intelligence -> Year-to-date total | Quick Measure |
| Format Currency | Measure Tools -> Currency | Currency |
Pro Tips & Modern Alternatives
- Write `CALCULATE([Total Sales], DATESYTD(Dim_Date[Date]))`; it is 100% mathematically identical to `TOTALYTD()`.
- Use `TOTALQTD` for quarterly performance reviews and executive board decks.