Sub topic 12
Fiscal years that do not end in December
This chapter assumes you can write basic DAX measures, know the star schema layout of a fact table and a date table, and have already built a year-to-date measure with TOTALYTD. Many organizations close their books on a date other than December 31. A year-to-date total must then reset on that date, not on January 1.
The problem with calendar year to date
TOTALYTD ( [Total Sales], 'Date'[Date] ) resets on January 1. If your fiscal year runs from July 1 to June 30, that measure gives totals that match no one's financial reports. In July, finance expects the total to restart at the first day of the new fiscal year. The calendar-year measure keeps adding sales from January.
The fix is to tell the function where the year ends.
Passing a year-end date
TOTALYTD and DATESYTD accept an optional last argument, the year-end date, written as a text string such as "6-30". The function treats that date as the last day of the year, and the running total restarts the day after.
Total Sales = SUM ( Sales[Sales Amount] )
Sales YTD Fiscal (June) =
TOTALYTD ( [Total Sales], 'Date'[Date], "6-30" )The same setting works with CALCULATE and DATESYTD:
Sales YTD Fiscal (CALCULATE) =
CALCULATE ( [Total Sales], DATESYTD ( 'Date'[Date], "6-30" ) )Both measures return the same result. Choose the form that matches the rest of your model.
What the year-end argument does
The year-end argument changes only the reset point. The function still returns dates from the first day of the fiscal year up to the last date in the current filter context. For a row showing September 2025 in a June year-end model, the result covers July 1, 2025 through September 30, 2025.
| Visual row | Calendar `TOTALYTD` covers | Fiscal `"6-30"` covers |
|---|---|---|
| March 2025 | Jan 1 to Mar 31, 2025 | Jul 1, 2024 to Mar 31, 2025 |
| September 2025 | Jan 1 to Sep 30, 2025 | Jul 1 to Sep 30, 2025 |
Notice that March 2025 belongs to the fiscal year that began in July 2024. The same function call can therefore reach back into the previous calendar year.
Add fiscal columns to the date table
The year-end argument fixes the measure. Your visuals also need a way to group rows by fiscal year, or the axis will still show calendar years. Add columns to the date table for that purpose. The following calculated columns assume a fiscal year that ends on June 30, and name each fiscal year by the calendar year in which it ends.
Fiscal Year =
YEAR ( 'Date'[Date] ) + IF ( MONTH ( 'Date'[Date] ) > 6, 1, 0 )
Fiscal Month Number =
MOD ( MONTH ( 'Date'[Date] ) - 7, 12 ) + 1With these columns, July is fiscal month 1 and June is fiscal month 12. A matrix with Fiscal Year on rows and Sales YTD Fiscal (June) as the value now lines up with finance reports. Sort the month name column by Fiscal Month Number so months appear in fiscal order.
Common mistakes
- Using
TOTALYTDwithout the year-end argument. The numbers look plausible and are wrong, so compare them with a known report. - Grouping visuals by calendar
Yearwhile the measure uses a fiscal year end. Each row then mixes two fiscal years. - Passing the first day of the new year, such as
"7-1", instead of the last day of the old one.
Exercise
Your company's fiscal year ends on March 31. Write a year-to-date measure over [Total Sales] and say what the value is for the row for May 2025.
Show answer
Sales YTD Fiscal (March) = TOTALYTD ( [Total Sales], 'Date'[Date], "3-31" ). For May 2025 it returns total sales from April 1, 2025 through May 31, 2025, because the fiscal year restarted on April 1.