Sub topic 11
Adding a fiscal calendar
This chapter assumes you already have a marked date table with a Date column, related to a fact table, and a Total Sales measure. You should also be comfortable adding calculated columns in DAX. Here the calendar is the default, January to December, and the fiscal year ends on June 30.
Why the calendar year is not enough
Many organizations report on a fiscal year that does not start on January 1. If your fiscal year ends June 30, then July 2025 belongs to fiscal year 2026. The built-in Year column puts that month in 2025, so any visual grouped by it shows the wrong totals for finance users.
The fix is to add fiscal columns to the date table. The relationships and the marked date table stay as they are.
Fiscal year and fiscal month columns
Add these as calculated columns on the Date table:
Fiscal Year = YEAR ( EDATE ( [Date], 6 ) )
Fiscal Month Number = MOD ( MONTH ( [Date] ) - 7, 12 ) + 1EDATE moves each date forward six months. July 2025 becomes January 2026, so YEAR returns 2026. Dates from January to June stay in the same year after the shift, so they also return the correct fiscal year.
Fiscal Month Number counts months from the start of the fiscal year. July gives MOD(0, 12) + 1 = 1. June gives MOD(-1, 12) + 1 = 12. DAX MOD returns a result with the sign of the divisor, so the negative value wraps correctly to 11.
| Calendar month | Month number | Fiscal month number |
|---|---|---|
| July | 7 | 1 |
| December | 12 | 6 |
| January | 1 | 7 |
| June | 6 | 12 |
Fiscal quarter and sorted month names
A fiscal quarter is three fiscal months, so you can derive it from the number you just built:
Fiscal Quarter = "FQ" & ROUNDUP ( DIVIDE ( [Fiscal Month Number], 3 ), 0 )
Fiscal Month = FORMAT ( [Date], "MMM" )You need a second month-name column because a text column can have only one sort-by column. The existing Month column is already sorted by Month Number. Select Fiscal Month and set Sort by column to Fiscal Month Number. Month names then appear July through June in charts and slicers.
A fiscal year-to-date measure
TOTALYTD accepts an optional year-end date as its third argument. Passing "6/30" makes the running total restart on July 1:
Total Sales = SUM ( Sales[Amount] )
Sales Fiscal YTD = TOTALYTD ( [Total Sales], 'Date'[Date], "6/30" )Use Fiscal Year and Fiscal Month on a visual's axis next to this measure. The total then accumulates from July through June and resets at the next July.
Common mistakes
- Using
Yearwith a fiscal measure.Sales Fiscal YTDrestarts in July, but a visual grouped by calendarYearsplits each fiscal year across two groups. UseFiscal Yearon the axis. - Skipping the sort order. Without
Fiscal Month Numberas the sort column, month names appear alphabetically. - Mislabeling the year. Some companies name the year by its start, so July 2025 is FY2025. The formula above names it by its end. Agree on the convention with your finance team before you publish, because changing it later breaks existing reports.
- Changing the year-end month in only one place. The
+6inEDATE, the7inMOD, and the"6/30"string all encode the same June year end. Update all three together if the year end changes.
Exercise
A company's fiscal year ends on September 30, and fiscal year 2026 runs from October 2025 to September 2026. Which values replace the 6 in EDATE, the 7 in MOD, and the "6/30" string?
Show answer
Use EDATE ( [Date], 3 ), MOD ( MONTH ( [Date] ) - 10, 12 ) + 1, and "9/30". Shifting October forward three months gives January, so October 2025 maps to fiscal year 2026. October is the first fiscal month, so the MOD offset is 10. The year-end string is the last day of the fiscal year, September 30.