Sub topic 12
Fiscal Years That Do Not End in December
This chapter assumes you have already written TOTALYTD and SAMEPERIODLASTYEAR measures on a marked, contiguous date table, and that you know how CALCULATE replaces filters. Here you will adapt those measures to a fiscal year that starts in a month other than January. The examples use a fiscal year that runs from July 1 to June 30.
Why the default year-to-date is wrong for a fiscal year
TOTALYTD and DATESYTD assume the year ends on December 31. If your company's year ends on June 30, a default Sales YTD on 15 October 2024 sums sales from 1 January 2024. The finance team expects the total from 1 July 2024.
The fix is a year-end argument. For reports that need fiscal labels such as "FY2025", you also need fiscal columns in the date table.
Passing the year-end date
TOTALYTD accepts an optional year-end date as a text literal. This measure resets the running total after June 30:
Total Sales = SUM ( Sales[Sales Amount] )
Sales YTD Fiscal (June) =
TOTALYTD ( [Total Sales], 'Date'[Date], "6-30" )Only the month and day of the string matter. The function ignores any year you include.
TOTALYTD is shorthand for CALCULATE plus DATESYTD, and DATESYTD takes the same optional argument:
Sales YTD Fiscal (CALCULATE) =
CALCULATE ( [Total Sales], DATESYTD ( 'Date'[Date], "6-30" ) )Both measures return the same numbers. Use whichever form your team finds easier to read. Use the CALCULATE form when you also need extra filters or want to combine several date filters in one call.
How the start date is chosen
The function finds the last date in the current filter context. It then finds the most recent fiscal year end on or before that date, and the visible range starts on the next day. This table shows the result for three report dates:
| Last visible date | Most recent year end | YTD window starts |
|---|---|---|
| 2024-10-15 | 2024-06-30 | 2024-07-01 |
| 2025-03-10 | 2024-06-30 | 2024-07-01 |
| 2025-07-05 | 2025-06-30 | 2025-07-01 |
At a fiscal year total, for example when Fiscal Year is on the rows, the last visible date is June 30. The window then covers the whole fiscal year. The "YTD" value on that row is therefore the full-year total.
Adding fiscal columns to the date table
The year-end argument fixes the calculation. It does nothing for labels. If the visual uses the calendar Year column, the YTD value restarts on 1 July in the middle of a calendar-year row, and the numbers look wrong.
Add fiscal columns so you can put the fiscal year on the axis:
Date =
ADDCOLUMNS (
CALENDAR ( DATE ( 2020, 1, 1 ), DATE ( 2025, 12, 31 ) ),
"Year", YEAR ( [Date] ),
"Month Number", MONTH ( [Date] ),
"Year Month", FORMAT ( [Date], "yyyy-MM" ),
"Fiscal Year", YEAR ( [Date] ) + IF ( MONTH ( [Date] ) >= 7, 1, 0 ),
"Fiscal Month Number", MOD ( MONTH ( [Date] ) - 7, 12 ) + 1,
"Fiscal Quarter", INT ( MOD ( MONTH ( [Date] ) - 7, 12 ) / 3 ) + 1
)This table names each fiscal year after the calendar year in which it ends. The fiscal year that starts on 1 July 2024 is FY2025.
| Calendar month | Fiscal Year (for 2024 dates) | Fiscal Month Number | Fiscal Quarter |
|---|---|---|---|
| July | 2025 | 1 | 1 |
| September | 2025 | 3 | 1 |
| December | 2025 | 6 | 2 |
| March | 2024 (for 2024-03) | 9 | 3 |
| June | 2024 (for 2024-06) | 12 | 4 |
The MOD expression shifts July to position 1. For June, MOD(6 - 7, 12) is MOD(-1, 12). DAX gives the result the sign of the divisor, so it returns 11, and adding 1 gives 12. If your platform's convention differs, check a few months by hand before building on this.
Put Fiscal Year and Fiscal Month Number on the axis, and sort any month-name column by Fiscal Month Number. Otherwise months sort alphabetically or starting from January.
You can also add a text label column in the model, for example "FY" & [Fiscal Year], as a separate calculated column. This is easier to read in slicers.
Prior year and growth on a fiscal basis
You do not need to change SAMEPERIODLASTYEAR. It shifts every visible date back one year, whatever the fiscal calendar looks like. To compare fiscal year-to-date with the same stretch of the previous fiscal year, evaluate the fiscal YTD measure under the shifted dates:
Sales YTD Fiscal PY =
CALCULATE ( [Sales YTD Fiscal (June)], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
Sales YTD Fiscal YoY % =
VAR CurrentYtd = [Sales YTD Fiscal (June)]
VAR PriorYtd = [Sales YTD Fiscal PY]
RETURN
DIVIDE ( CurrentYtd - PriorYtd, PriorYtd )For a visible last date of 2025-03-10, the shifted last date is 2024-03-10. The inner YTD measure then starts at 2023-07-01, which is the correct prior fiscal year start.
Fiscal quarter to date
DATESQTD and TOTALQTD have no year-end argument. They always use calendar quarters (January to March, and so on). For a July fiscal year, calendar quarters start in the same months as fiscal quarters (July, October, January, April), so they happen to match. A fiscal year that starts in, say, February or May breaks that match. For a fiscal year starting in a month that is not January, April, July or October, you need a custom measure.
First add a key column to the date table, as a calculated column:
Fiscal Quarter Key =
'Date'[Fiscal Year] * 10 + 'Date'[Fiscal Quarter]Then write the measure against that key:
Sales Fiscal QTD =
VAR LastDate = MAX ( 'Date'[Date] )
VAR QuarterKey = MAX ( 'Date'[Fiscal Quarter Key] )
RETURN
CALCULATE (
[Total Sales],
FILTER (
ALL ( 'Date' ),
'Date'[Fiscal Quarter Key] = QuarterKey
&& 'Date'[Date] <= LastDate
)
)MAX of the quarter key returns the quarter that contains the last visible date, because the key increases with time. FILTER ( ALL ( 'Date' ), ... ) removes the existing date filters and keeps only the days in that quarter up to the last visible date.
The same pattern works for a custom year start. Replace the quarter key with a fiscal year column to build a fiscal year-to-date by hand.
Pitfalls specific to fiscal years
- Year-end string format. The text is interpreted with the locale of the model. Month-then-day, such as
"6-30", is the safe form because day 30 cannot be a month. An ambiguous string such as"3-4"can be read as March 4 or April 3. After setting it, check a known date by hand. - Year-ends that move. Strings like
"2-28"describe one fixed day. If your fiscal year ends on the last day of February, leap years need testing. Compare the YTD value for 29 February with a manual total. - Calendar year on the axis. A fiscal YTD measure on a calendar-year axis resets mid-row. Use
Fiscal Year. - Naming conventions. Some companies name the fiscal year after the year it starts, not the year it ends. Change the
IFcondition to match, and confirm with finance before publishing. - Date table that ends mid-year. If the last date in the table is in December 2025, FY2026 is only half present. Extend the table to cover whole fiscal years so totals and prior-year comparisons stay complete.
- Future dates. The capped measure from the incomplete-periods chapter still applies: wrap the fiscal YTD in the same last-sale-date check so the line stops where the data stops.
Checking your work
- Put
Fiscal YearandFiscal Month Numberin a matrix, withTotal SalesandSales YTD Fiscal (June)as values. - Confirm the YTD for month 1 equals that month's total.
- Confirm the YTD for month 12 equals the full-year total.
- Add
Sales YTD Fiscal PYand check that month 1 shows the prior year's July value.
Exercise
Your fiscal year runs from April 1 to March 31 and is named after the calendar year in which it ends. Write the fiscal YTD measure, then write the Fiscal Year and Fiscal Month Number expressions for the date table.
Show answer
Fiscal YTD: Sales YTD Fiscal (March) = TOTALYTD ( [Total Sales], 'Date'[Date], "3-31" ). Fiscal Year: YEAR ( [Date] ) + IF ( MONTH ( [Date] ) >= 4, 1, 0 ). Fiscal Month Number: MOD ( MONTH ( [Date] ) - 4, 12 ) + 1, so April is 1 and March is 12.
Exercise
Why would DATESQTD give wrong fiscal quarter-to-date numbers for a fiscal year that starts on February 1, and what do you use instead?
Show answer
DATESQTD always uses calendar quarters that start in January, April, July and October, and it has no year-end argument. Fiscal quarters starting in February, May, August and November do not line up with them. Add a fiscal quarter key column to the date table and write a measure that uses FILTER over ALL ( 'Date' ) to keep dates in the same fiscal quarter up to the last visible date.