Sub topic 2
Automatic date/time: what it does and where it falls short
Prerequisites
This chapter assumes you can move between Report, Table, and Model views in Power BI Desktop. It also assumes you know what a fact table is and can read basic DAX. You do not need to have built a date table yet. That comes in later chapters.
What automatic date/time does
Power BI Desktop has an option called Auto date/time. It is on by default for new files. When it is on, Power BI looks at every column of type Date or Date/Time in your model. For each one, it creates a hidden calculated table in the background. That table holds one row per date across the column's range, plus built-in columns for Year, Quarter, Month, and Day.
You can see the effect in the Report view. Drag Sales[OrderDate] onto a visual and a date hierarchy appears. You can expand it from Year to Quarter to Month to Day without writing any DAX. For a quick chart, this is convenient.
The hidden tables do not appear in Model view or in the Data pane. You cannot add columns to them, change their relationships, or reuse them from another table.
Where it falls short
The same design that makes it easy also causes problems once a model grows.
| Limitation | What happens |
|---|---|
| One hidden table per date column | A fact table with `OrderDate`, `ShipDate`, and `DueDate` gets three separate hidden tables. A slicer on one does not filter the others. |
| No shared calendar | Two fact tables, such as Sales and Budget, each get their own hidden table. You cannot slice both with one Year or Month field. |
| No custom columns | You cannot add fiscal year, week number, or a holiday flag. |
| Fixed hierarchy | Only Year, Quarter, Month, and Day are offered. |
| Model size | Each hidden table adds data to the file. With many date columns, this adds up. |
| Limited to Power BI Desktop | The feature is specific to Power BI Desktop's import model. It does not carry over to every model type. |
| Limited control over month names | Month names come from the model's locale, so you cannot change their format or sort order. |
The first two rows cause the most trouble in practice. A report should have one calendar that filters every fact table. Auto date/time gives you many, and they do not talk to each other.
Why this matters for time intelligence
Time intelligence functions such as TOTALYTD and SAMEPERIODLASTYEAR need a column of unbroken dates. Auto date/time supplies that, so simple measures can work. The trouble starts when your needs go beyond the basics.
Suppose you want a fiscal year that ends June 30. You want one Month slicer that drives both Sales and Budget. You want to compare order date and ship date in the same report. None of these is possible with the hidden tables. A dedicated date table handles all three.
Turning it off
You can turn the feature off for the current file or for all new files.
- Choose File, then Options and settings, then Options.
- For one file, open Current File, then Data Load, and clear Auto date/time.
- For new files, open Global, then Data Load, and clear Auto date/time for new files.
When you turn it off for a file, the hidden tables are removed. Any visual that used the built-in hierarchy, such as Sales[OrderDate].[Month], loses that field. Replace those fields with columns from your own date table. Do this after you have built the date table, not before.
Checking whether it is on
Open Model view and look at the Data pane. Hidden date tables are not listed there. A reliable sign is that a date column in the Data pane shows an expandable hierarchy with Year, Quarter, Month, and Day beneath it. If you see that, auto date/time is active for that column.
Exercise
A model has a Sales fact table with OrderDate and ShipDate, and a Budget fact table with BudgetDate. Auto date/time is on. Why can't one Month slicer filter both Sales and Budget, and what replaces the hidden tables?
Show answer
Each date column gets its own hidden date table, and those tables have no relationship to each other. A slicer built on one of them filters only the fact table it belongs to. A single dedicated date table, related to OrderDate, BudgetDate, and optionally ShipDate through an inactive relationship, gives all the fact tables one shared calendar.