TOTALYTD Function
The DAX TOTALYTD function calculates the year‑to‑date (YTD) total of a measure, accumulating values from the beginning of the year up to the last date in the current filter context. It is the standard way to compute YTD in Power BI.
TOTALYTD sums a measure from the first day of the year (or a specified fiscal year start) to the current date in context, making it essential for cumulative annual performance tracking.
Contents
- What is TOTALYTD?
- Syntax
- How TOTALYTD works
- Date table & context
- Basic examples
- Real‑world examples
- YTD Sales
- Fiscal Year YTD
- YTD with table (monthly view)
- YTD in a visual
- YTD vs previous year YTD
- TOTALYTD vs CALCULATE + DATESYTD
- Filter context & visuals
- TOTALYTD vs related functions
- Common mistakes
- Performance & best practices
- Practical patterns
- Mental model
- Quick reference
- Final summary
1. What is TOTALYTD?
TOTALYTD evaluates a measure over the period from the start of the year (or fiscal year) to the last date in the current filter context. It is a time‑intelligence function that simplifies YTD calculations.
| Context (current date) | TOTALYTD returns |
|---|---|
| March 15, 2026 | Sum from Jan 1, 2026 to Mar 15, 2026 |
| December 31, 2026 | Sum from Jan 1, 2026 to Dec 31, 2026 (full year) |
| June 30, 2026 (fiscal year starts Jul 1) | Sum from Jul 1, 2025 to Jun 30, 2026 |
2. Syntax
TOTALYTD(<expression>, <dates>, [<filter>], [<year_end_date>])| Argument | Description | Example |
|---|---|---|
<expression> | The measure to aggregate (e.g., SUM). | [Total Sales] |
<dates> | A date column (usually from Date table). | 'Date'[Date] |
<filter> (optional) | Additional filter to apply. | ALL('Product') |
<year_end_date> (optional) | End of fiscal year (e.g., “6-30”). | "6-30" |
The year_end_date parameter is a string in "MM-DD" format.
3. How TOTALYTD Works
It takes the current filter context, finds the latest date in that context, and sums the expression from the first day of that year (or fiscal year) up to that date.
Current filter context: March 2026 (e.g., 2026-03-15)
↓
TOTALYTD([Total Sales], 'Date'[Date])
↓
Evaluates: SUM of [Total Sales] from 2026-01-01 to 2026-03-15
↓
Returns: YTD Sales = $340,000The function uses the last date in the current context. If the context is a month (March 2026), it uses March 31, 2026 as the end date.
4. Date Table & Context
For reliable results, use a continuous Date table with no gaps. TOTALYTD relies on the date column to determine the year boundaries and the current date.
5. Basic Examples
Standard YTD Sales
YTD Sales = TOTALYTD([Total Sales], 'Date'[Date])YTD Sales with fiscal year ending June 30
YTD Sales Fiscal = TOTALYTD([Total Sales], 'Date'[Date],, "6-30")YTD Sales with additional filter
YTD Sales Online = TOTALYTD([Total Sales], 'Date'[Date], 'Sales'[Channel] = "Online")6. Three Real‑World Examples
Example 1: Retail YTD Sales
YTD Sales = TOTALYTD([Total Sales], 'Date'[Date])If the current context is March 31, 2026, this returns sales from January 1 to March 31, 2026.
Example 2: Fiscal YTD (April–March fiscal year)
YTD Sales Fiscal = TOTALYTD([Total Sales], 'Date'[Date],, "3-31")If the current context is December 2026, this returns sales from April 1, 2026 to December 31, 2026.
Example 3: YTD Profit
YTD Profit = TOTALYTD([Total Profit], 'Date'[Date])7. YTD Sales – with Example Table
Consider monthly sales data for 2026:
| Month | Monthly Sales | YTD Sales (TOTALYTD) |
|---|---|---|
| January | 100,000 | 100,000 |
| February | 120,000 | 220,000 |
| March | 110,000 | 330,000 |
| April | 130,000 | 460,000 |
| May | 140,000 | 600,000 |
| June | 125,000 | 725,000 |
| July | 150,000 | 875,000 |
| August | 160,000 | 1,035,000 |
| September | 145,000 | 1,180,000 |
| October | 155,000 | 1,335,000 |
| November | 170,000 | 1,505,000 |
| December | 180,000 | 1,685,000 |
Formula used:
YTD Sales = TOTALYTD([Monthly Sales], 'Date'[Date])8. Fiscal Year YTD (July–June)
For a fiscal year ending June 30, use the year_end_date parameter:
YTD Sales Fiscal = TOTALYTD([Monthly Sales], 'Date'[Date],, "6-30")| Month | Monthly Sales | Fiscal YTD (Jul–Jun) |
|---|---|---|
| July 2025 | 90,000 | 90,000 |
| August 2025 | 95,000 | 185,000 |
| September 2025 | 100,000 | 285,000 |
| October 2025 | 105,000 | 390,000 |
| November 2025 | 110,000 | 500,000 |
| December 2025 | 115,000 | 615,000 |
| January 2026 | 120,000 | 735,000 |
| February 2026 | 125,000 | 860,000 |
| March 2026 | 130,000 | 990,000 |
| April 2026 | 135,000 | 1,125,000 |
| May 2026 | 140,000 | 1,265,000 |
| June 2026 | 145,000 | 1,410,000 |
Result: Fiscal YTD resets every July 1.
9. YTD in a Matrix / Table
When placed in a matrix with Year and Month on rows, TOTALYTD automatically calculates the cumulative total for each year.
| Year | Month | Monthly Sales | YTD Sales |
|---|---|---|---|
| 2025 | Jan | 80,000 | 80,000 |
| 2025 | Feb | 85,000 | 165,000 |
| 2025 | Mar | 90,000 | 255,000 |
| 2026 | Jan | 100,000 | 100,000 |
| 2026 | Feb | 120,000 | 220,000 |
| 2026 | Mar | 110,000 | 330,000 |
10. YTD in a Line Chart
When you place YTD Sales on a line chart with Month on the X‑axis, you see a cumulative line that climbs throughout the year and resets each January.
| Month | Monthly Sales | YTD Sales (line chart value) |
|---|---|---|
| Jan | 100k | 100k |
| Feb | 120k | 220k |
| Mar | 110k | 330k |
| Apr | 130k | 460k |
| May | 140k | 600k |
| Jun | 125k | 725k |
This visual is excellent for tracking annual progress.
11. YTD vs Previous Year YTD
Compare current YTD with the same period last year:
YTD Sales Prior Year =
VAR CurrentYTD = TOTALYTD([Total Sales], 'Date'[Date])
VAR PriorYearYTD =
CALCULATE(
[Total Sales],
DATESYTD(SAMEPERIODLASTYEAR('Date'[Date]))
)
RETURN PriorYearYTDOr use the simpler TOTALYTD with SAMEPERIODLASTYEAR:
YTD Sales LY =
TOTALYTD(
[Total Sales],
SAMEPERIODLASTYEAR('Date'[Date])
)| Month | YTD Sales 2026 | YTD Sales 2025 (LY) |
|---|---|---|
| Jan | 100,000 | 80,000 |
| Feb | 220,000 | 165,000 |
| Mar | 330,000 | 255,000 |
12. TOTALYTD vs CALCULATE + DATESYTD
TOTALYTD is a convenience function that wraps CALCULATE and DATESYTD.
-- These are equivalent:
TOTALYTD([Total Sales], 'Date'[Date])
CALCULATE([Total Sales], DATESYTD('Date'[Date]))Use TOTALYTD for simplicity and readability.
13. Filter Context & Visual Behavior
TOTALYTD respects the current filter context. If a visual is filtered to a specific date range, YTD is calculated within that context.
14. TOTALYTD vs Related Functions
| Function | Purpose | When to use |
|---|---|---|
TOTALYTD | Year‑to‑date total | Standard YTD |
DATESYTD | Returns YTD date table | Inside CALCULATE for custom YTD |
TOTALQTD | Quarter‑to‑date total | QTD analysis |
TOTALMTD | Month‑to‑date total | MTD analysis |
DATESINPERIOD | Interval from a base date | Rolling windows |
15. Common Mistakes
- Using a transaction date column: gaps in the date column lead to missing dates in the YTD calculation.
- Forgetting the fiscal year parameter: if your fiscal year doesn’t start in January, you must specify
year_end_date. - Ignoring relationships: the Date table must be related to the fact table.
- Not handling incomplete periods: comparing YTD for a partial month with a full month can be misleading.
- Confusing with TOTALQTD or TOTALMTD: YTD is year‑to‑date, not quarter or month.
16. Performance & Best Practices
- Use a continuous Date table marked as a date table.
- Use
TOTALYTDfor simple, readable YTD measures. - Specify the
year_end_dateparameter for fiscal years. - Use
VARfor complex YTD calculations (e.g., YoY YTD comparisons). - Test with incomplete periods to avoid misleading visualisations.
17. Practical Patterns
Standard YTD
YTD Sales = TOTALYTD([Total Sales], 'Date'[Date])Fiscal YTD (ends June 30)
YTD Sales Fiscal = TOTALYTD([Total Sales], 'Date'[Date],, "6-30")YTD with filter (e.g., Online channel)
YTD Sales Online = TOTALYTD([Total Sales], 'Date'[Date], 'Sales'[Channel] = "Online")YTD vs Previous Year YTD
YTD Sales LY = TOTALYTD([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))YoY YTD Growth %
YoY YTD % =
VAR Current = TOTALYTD([Total Sales], 'Date'[Date])
VAR Prior = TOTALYTD([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
RETURN DIVIDE(Current - Prior, Prior)18. Simple Mental Model
Current date context (e.g., March 2026)
↓
TOTALYTD([Measure], 'Date'[Date])
↓
Finds the last date in context (March 31, 2026)
↓
Sums [Measure] from Jan 1, 2026 to March 31, 2026
↓
Returns: YTD total19. Quick Reference
| Scenario | DAX |
|---|---|
| Standard YTD | TOTALYTD([Total Sales], 'Date'[Date]) |
| Fiscal YTD (ends June 30) | TOTALYTD([Total Sales], 'Date'[Date],, "6-30") |
| YTD with filter | TOTALYTD([Total Sales], 'Date'[Date], 'Sales'[Channel] = "Online") |
| YTD Previous Year | TOTALYTD([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])) |
| YoY YTD Growth % | VAR C=TOTALYTD([Sales],'Date'[Date]) VAR P=TOTALYTD([Sales],SAMEPERIODLASTYEAR('Date'[Date])) RETURN DIVIDE(C-P,P) |
20. Final Summary
TOTALYTD is the standard and most convenient function for year‑to‑date calculations in Power BI. It accumulates a measure from the beginning of the year (or fiscal year) to the current date in context.
- Use
TOTALYTDfor simple, readable YTD measures. - Specify
year_end_datefor fiscal years. - Combine with
SAMEPERIODLASTYEARfor YoY YTD comparisons. - A proper Date table is essential for reliable results.
- It is equivalent to
CALCULATE([Measure], DATESYTD('Date'[Date])).
TOTALYTD calculates the cumulative total of a measure from the start of the year (or fiscal year) to the current date in context.






