5 signs your business reporting should be automated
If your team spends hours every week rebuilding the same spreadsheets, you are paying a hidden tax. Here's how to spot it, and what to do about it.
Almost every Power BI report answers a question about time. How did sales do this month? Are we ahead of last year? What is the year-to-date figure for the financial year? Getting those answers right depends on one unglamorous table: the date table.
This guide explains what a date table is, why the built-in option only goes so far, and how to build, mark and use your own with a few lines of DAX.
A date table is simply a table with one row for every day across the period your data covers, plus useful columns describing each day: year, quarter, month name, weekday and so on. Your fact tables (sales, orders, invoices) then relate to it through their date columns.
Microsoft's guidance sets out clear requirements. The date column must:
Get that right and every visual slices by year, quarter or month from one consistent source.
Power BI Desktop has an option called Auto date/time, switched on by default in a new installation. For each eligible date column in an Import table, it quietly creates a hidden date table with a Year, Quarter, Month and Day hierarchy.
It is convenient for quick exploration, but it has real limitations:
Microsoft recommends keeping auto date/time only for simple, calendar-based models or ad hoc exploration. To switch it off for new files, go to File > Options and settings > Options and use the Time intelligence section of the Global page.
In Power BI Desktop, go to Modeling > New table and enter the following. It assumes a Sales table with an OrderDate column, so swap in your own names.
Date =
ADDCOLUMNS (
CALENDAR (
DATE ( YEAR ( MIN ( Sales[OrderDate] ) ), 1, 1 ),
DATE ( YEAR ( MAX ( Sales[OrderDate] ) ), 12, 31 )
),
"Year", YEAR ( [Date] ),
"Quarter", "Q" & QUARTER ( [Date] ),
"Month Number", MONTH ( [Date] ),
"Month Name", FORMAT ( [Date], "mmm" ),
"Year Month", FORMAT ( [Date], "mmm yyyy" ),
"Year Month Sort", YEAR ( [Date] ) * 100 + MONTH ( [Date] ),
"Weekday Number", WEEKDAY ( [Date], 2 ),
"Weekday Name", FORMAT ( [Date], "ddd" )
)
Here is what each part does:
CALENDAR returns a single column called Date containing every day between a start and end date, inclusive.DATE ( YEAR ( … ), 1, 1 ) and DATE ( YEAR ( … ), 12, 31 ) rounds the range out to full years, which keeps you within the requirements above.WEEKDAY with a second argument of 2 numbers the week from Monday (1) to Sunday (7), which suits UK reporting better than the default Sunday start.If you would rather the table cover every date found anywhere in the model, CALENDARAUTO() is an alternative to CALENDAR. It also returns full years, but a stray placeholder date such as 1900 elsewhere in the model will stretch the range.
One thing to watch: FORMAT produces text using the model's locale, so month and day names follow your report's language settings.
Text columns sort alphabetically, so "Apr" will appear before "Jan" in your visuals. Fix this with Sort by column:
Month Name column in the Data pane.Month Number.Year Month (sort by Year Month Sort) and Weekday Name (sort by Weekday Number).Next, tell Power BI this is your date table. Right-click the Date table in the Data pane and choose Mark as date table, then select the Date column.
Power BI checks that the column has unique values, no blanks and a contiguous range of dates. Marking it is required if you use the standard (classic) DAX time intelligence functions, such as the ones in step 5.
Two side effects are worth knowing:
In Model view, drag Date[Date] onto Sales[OrderDate] to create a one-to-many relationship from the date table to the sales table. From now on, use the columns from the date table in your slicers and visuals, not the date column in the sales table.
If you have several fact tables, such as sales and budgets, relate each one to the same date table. That single, shared calendar is the main reason to build one.
Many UK organisations report on a financial year from 1 April to 31 March. Add these as calculated columns on the Date table:
Fiscal Year =
VAR FYStart =
IF (
MONTH ( 'Date'[Date] ) >= 4,
YEAR ( 'Date'[Date] ),
YEAR ( 'Date'[Date] ) - 1
)
RETURN
"FY " & FYStart & "/" & RIGHT ( FORMAT ( FYStart + 1, "0" ), 2 )
Fiscal Month Number = MOD ( MONTH ( 'Date'[Date] ) - 4, 12 ) + 1
Fiscal Year labels 15 May 2026 as "FY 2026/27", and Fiscal Month Number makes April month 1 and March month 12. DAX's MOD returns a result with the same sign as the divisor, so January (month 1) correctly becomes fiscal month 10. If you rely on fiscal years, consider starting your table on 1 April and ending it on 31 March so the range covers whole financial years.
Now the time intelligence measures. Assuming a base measure such as Total Sales = SUM ( Sales[Amount] ):
Sales YTD = TOTALYTD ( [Total Sales], 'Date'[Date] )
Sales FYTD = TOTALYTD ( [Total Sales], 'Date'[Date], "3/31" )
Sales Last Year =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
The last argument of TOTALYTD sets the year-end date, so "3/31" gives a financial year-to-date ending on 31 March. Microsoft recommends the month/day form for this string, and notes it must resolve in the locale of the report, so test it with your own settings.
Microsoft has introduced calendar-based time intelligence, which defines calendars (including week-based ones) as metadata on a table. At the time of writing it is a preview feature, enabled through the Enhanced DAX Time Intelligence preview option. It still builds on a date table like this one, so nothing here is wasted.
A good date table takes ten minutes to build and saves hours of confusion later. Create it with CALENDAR and ADDCOLUMNS, round it out to full years, sort your month names, mark it as a date table and relate it to every fact table. Then build your year-to-date and last-year measures on top of it.
Better still, save it in a Power BI template so every new project starts with the same trusted calendar.
Free every Friday
Join our free live class every Friday at 6pm UK time: hands-on lessons, live Q&A and career tips from a working Senior Data Analyst.
Keep reading
If your team spends hours every week rebuilding the same spreadsheets, you are paying a hidden tax. Here's how to spot it, and what to do about it.
I arrived in the UK with an engineering career behind me and no local experience. Here's the honest story of how I moved into data, and the lessons I'd pass on to anyone making the switch.
What Fabric is, how it relates to Power BI, what it costs to run, and how to tell whether your business actually needs it yet.