Sub topic 11
Adding a fiscal calendar
This chapter assumes you already have a marked date table named 'Date' with a [Date] column, related to a fact table. It also assumes a [Total Sales] measure, and that you know how to set Sort by column. If your fiscal year starts on January 1, you don't need this chapter. The calendar year already matches your fiscal year.
What changes in a fiscal calendar
A fiscal year is the 12-month period an organization uses for budgeting and reporting. It often starts in a month other than January. In this chapter the fiscal year ends on June 30, so it runs from July 1 to June 30.
Two decisions come first.
- Year-end month. This is the month in which the fiscal year closes. Everything else follows from it.
- Naming convention. Most organizations name the fiscal year after the calendar year in which it ends, so July 2025 to June 2026 is FY2026. Some use the starting year. Pick one and apply it everywhere. The formulas below use the ending-year convention.
You add fiscal columns to the date table you already have. You don't build a second table. The relationship, the marking, and the time intelligence measures stay as they are.
Fiscal year and fiscal month columns
For a fiscal year ending June 30, add these calculated columns to the date table:
Fiscal Year = YEAR ( EDATE ( [Date], 6 ) )
Fiscal Month Number = MOD ( MONTH ( [Date] ) - 7, 12 ) + 1EDATE shifts a date forward by a number of months. Adding 6 moves every date in July 2025 to June 2026 into calendar year 2026. YEAR then reads the fiscal year from the shifted date. July 1, 2025 becomes January 1, 2026, which gives FY2026. June 30, 2026 becomes December 30, 2026, which also gives FY2026.
Fiscal Month Number counts months from the start of the fiscal year. Subtracting 7 makes July equal 0. MOD wraps the result into the range 0 to 11, and adding 1 gives 1 to 12. DAX MOD returns a result with the sign of the divisor. For June, MOD(-1, 12) is 11, so June becomes month 12. Some other languages return -1 here, so don't copy this pattern from them without checking.
| Calendar month | Fiscal month number | Fiscal quarter number |
|---|---|---|
| July | 1 | 1 |
| September | 3 | 1 |
| October | 4 | 2 |
| January | 7 | 3 |
| April | 10 | 4 |
| June | 12 | 4 |
Adapting the formulas to another year-end
Let M be the year-end month number. The general forms are:
Fiscal Year = YEAR ( EDATE ( [Date], 12 - M ) )Fiscal Month Number = MOD ( MONTH ( [Date] ) - ( M + 1 ), 12 ) + 1
For M = 6 these reduce to the formulas above. For M = 12 (a calendar-year company) the offset is 0 and the month number equals the calendar month number, so the formulas are safe to reuse as a template.
Fiscal quarter and label columns
Add the quarter number from the fiscal month number:
Fiscal Quarter Number = INT ( ( [Fiscal Month Number] - 1 ) / 3 ) + 1
Fiscal Quarter = "FQ" & [Fiscal Quarter Number]
Fiscal Year Label = "FY" & [Fiscal Year]
Fiscal Year-Quarter = "FY" & [Fiscal Year] & " Q" & [Fiscal Quarter Number]
Fiscal Year-Quarter Key = [Fiscal Year] * 10 + [Fiscal Quarter Number]
Fiscal Month = FORMAT ( [Date], "MMM" )Fiscal Month has the same text as the calendar Month column. It exists because a column can have only one Sort by column setting. The calendar Month column sorts by Month Number, which puts January first. A visual showing fiscal months needs July first, so it needs its own text column.
Sorting the fiscal text columns
Set Sort by column on each text column so the visuals do not fall back to alphabetical order:
| Text column | Sort by column |
|---|---|
| `Fiscal Month` | `Fiscal Month Number` |
| `Fiscal Quarter` | `Fiscal Quarter Number` |
| `Fiscal Year-Quarter` | `Fiscal Year-Quarter Key` |
| `Fiscal Year Label` | `Fiscal Year` |
Each text value must map to exactly one number. Fiscal Quarter shows "FQ1" for every fiscal year, and that is fine because "FQ1" always maps to 1. If you removed the year from Fiscal Year-Quarter, the same logic would still hold. That is why the year-quarter column needs the key column instead of just the quarter number: the same quarter number appears in many years, so the label "FY2026 Q1" must map to a unique key, 20261.
Fiscal time intelligence measures
The time intelligence functions that take a year_end_date argument handle the fiscal year for you:
Total Sales = SUM ( Sales[Amount] )
Sales Fiscal YTD = TOTALYTD ( [Total Sales], 'Date'[Date], "6/30" )
Sales Fiscal PY YTD =
CALCULATE ( [Sales Fiscal YTD], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )The third argument tells TOTALYTD where the year ends. The total restarts on July 1 instead of January 1. DATESYTD accepts the same argument if you need the date list instead of a total.
SAMEPERIODLASTYEAR shifts dates back by exactly one year, so it works for fiscal and calendar years alike. Wrapping the fiscal YTD measure inside it gives the prior fiscal year's running total up to the same point.
The year-end string is parsed using the model's locale. "6/30" works for a US-style locale. If the measure returns the calendar year-to-date or raises an error in another locale, try an unambiguous form such as "30-6" or "06-30", and test it.
Quarter-to-date is different
TOTALQTD and DATESQTD have no year_end_date argument. They always use calendar quarters (January to March, and so on), so a fiscal quarter-to-date measure built with them is wrong for any non-calendar fiscal year. Build it from the fiscal columns instead:
Sales Fiscal QTD =
VAR CurrentDate = MAX ( 'Date'[Date] )
VAR CurrentYear = MAX ( 'Date'[Fiscal Year] )
VAR CurrentQuarter = MAX ( 'Date'[Fiscal Quarter Number] )
RETURN
CALCULATE (
[Total Sales],
FILTER (
ALL ( 'Date' ),
'Date'[Fiscal Year] = CurrentYear
&& 'Date'[Fiscal Quarter Number] = CurrentQuarter
&& 'Date'[Date] <= CurrentDate
)
)The three variables capture the current context before ALL ( 'Date' ) removes it. The filter then keeps dates in the same fiscal quarter up to the latest visible date. The measure assumes the visible context sits in one fiscal quarter. In a visual that shows a whole fiscal year, MAX picks the last quarter, so use the measure on a quarter, month, or day axis.
Boundaries and coverage
A fiscal year that is only partly in the date table gives wrong results. If your table runs from January 1, 2020 to December 31, 2026, the first fiscal year is FY2020, which starts on July 1, 2019. Only half of it is present, so its YTD value will look low. Two fixes work:
- Start the table on the first day of a fiscal year and end it on the last day of one. For a June year-end, that means July 1 to June 30.
- Keep the calendar-year range, but hide or filter out the partial fiscal years in reports.
A calculated date table built with CALENDAR makes the first fix simple:
Date =
CALENDAR ( DATE ( 2019, 7, 1 ), DATE ( 2027, 6, 30 ) )Then add the fiscal columns as above. This range gives eight complete fiscal years, FY2020 to FY2027.
Weeks and 52/53-week calendars
Some organizations use a 4-4-5 or 52/53-week fiscal calendar, where periods are a fixed number of weeks and do not follow month boundaries. The formulas in this chapter do not cover that. A 52/53-week calendar needs period boundaries from your finance team, usually supplied as a table you import. Since the periods are not derived from EDATE, you would build the columns from that table and set Sort by column the same way.
Verifying the fiscal columns
Check the results before building reports on them:
- Put
Date,Fiscal Year, andFiscal Month Numberin a table visual and filter to June 30 and July 1 of one year. The fiscal year should change between them, and the fiscal month number should go from 12 to 1. - Put
Fiscal Monthon a chart axis. The months should run July to June, not alphabetically and not January first. - Compare
Sales Fiscal YTDfor the last day of a fiscal year with the total for that year usingFiscal Yearas a filter. They should match.
If a visual shows calendar-year totals, check that the axis uses the fiscal columns and not the built-in date hierarchy. Also check that the measure passes the year-end argument.
Exercise
Your fiscal year ends March 31 and is named by its ending year. Write the Fiscal Year column, the Fiscal Month Number column, and a fiscal year-to-date measure over [Total Sales].
Show answer
Fiscal Year = YEAR ( EDATE ( [Date], 9 ) ). Fiscal Month Number = MOD ( MONTH ( [Date] ) - 4, 12 ) + 1. Sales Fiscal YTD = TOTALYTD ( [Total Sales], 'Date'[Date], "3/31" ). With M = 3, the offset is 12 - 3 = 9 months and the subtracted month is M + 1 = 4. April 1, 2026 shifts to January 1, 2027, so it belongs to FY2027 and is fiscal month 1.
Exercise
A report shows Sales Fiscal QTD built with TOTALQTD. For a June year-end, why do its values start over in January, April, July, and October, and what is the fix?
Show answer
TOTALQTD has no yearenddate argument. It always uses calendar quarters, which start in January, April, July, and October. For a June year-end, July is the start of fiscal Q1, but October starts fiscal Q2 and January starts fiscal Q3 only by coincidence of boundaries, so the results do not align with the fiscal calendar in general. Build the measure from the fiscal columns, as in Sales Fiscal QTD above, which filters by Fiscal Year, Fiscal Quarter Number, and dates up to the current date.