Rules / Performance

Remove auto-date table

warning REMOVE_AUTO-DATE_TABLE · ported · model layer · scope: Table, CalculatedTable

What it checks

Calculated tables generated by the Auto date/time option, whose names start with DateTableTemplate_ or LocalDateTable_.

Each finding names the table, as 'LocalDateTable_8f2c1b4e', so there is one per date column the option built a calendar for, plus the template table.

Example

Fires the rule
table Sales
	column 'Order Date'
		dataType: dateTime
		formatString: mm/dd/yyyy
		sourceColumn: OrderDate

	column Amount
		dataType: decimal
		summarizeBy: sum
		sourceColumn: Amount

table LocalDateTable_8f2c1b4e
	isHidden

	column Date
		dataType: dateTime
		formatString: mm/dd/yyyy
		sourceColumn: [Date]

	column Year
		dataType: int64
		summarizeBy: none
		sourceColumn: [Year]

	partition LocalDateTable_8f2c1b4e = calculated
		mode: import
		source = Calendar(Date(Year(MIN('Sales'[Order Date])), 1, 1), Date(Year(MAX('Sales'[Order Date])), 12, 31))
After the fix
table Sales
	column 'Order Date'
		dataType: dateTime
		formatString: mm/dd/yyyy
		sourceColumn: OrderDate

	column Amount
		dataType: decimal
		summarizeBy: sum
		sourceColumn: Amount

table Date
	dataCategory: Time

	column Date
		dataType: dateTime
		isKey
		formatString: mm/dd/yyyy
		sourceColumn: Date

	column Year
		dataType: int64
		summarizeBy: none
		sourceColumn: Year

Why it matters

With Auto date/time on, Power BI Desktop creates a hidden calculated date table for every date column in the model, each with its own year, quarter, month, and day hierarchy. A model with a dozen date columns carries a dozen hidden tables, all rebuilt on every refresh, and none of them can be extended with fiscal periods or holidays or shared between fact tables. One real date table does everything they do, once.

How to fix it

In Power BI Desktop, open File, Options and settings, Options, then Current file, Data Load, and clear Auto date/time. Desktop deletes the hidden tables and the variations that point at them when the file is saved, so the table LocalDateTable_... blocks leave the project's TMDL files on the next save. The option itself is recorded on the model as annotation __PBI_TimeIntelligenceEnabled, which Desktop writes and clears for you rather than a property to edit by hand, and deleting the table blocks yourself without clearing the option only invites Desktop to write them again. Then give the model a calendar of its own: add a date table, relate each fact table's date column to it, and mark it with Mark as date table under Table tools, which writes dataCategory: Time on the table and isKey on its date column. Report authors lose the automatic date hierarchy under each date column when the option goes off, so expect to rebuild the visuals that used one against the new table's Year, Quarter, and Month columns.

When to ignore it

There is no lasting exception. These tables are not something a modeler chose, they are what Power BI Desktop falls back to, and every one of them is replaced by the single calendar the model should have anyway. The one honest reason to leave a finding for now is sequencing: in a report with many visuals built on the automatic date hierarchies, clearing the option breaks all of them at once, so the calendar goes in first, the visuals move across, and the option goes off last. That is a plan with a date on it rather than a decision to ignore the rule.

To ignore this rule on one object, add annotation pbiplint.ignore = REMOVE_AUTO-DATE_TABLE under the object in its TMDL file. Power BI Desktop keeps the annotation. To turn the rule off for a whole project, set "REMOVE_AUTO-DATE_TABLE": "off" under rules in pbiplint.config.json.

Quirks

Ported from Microsoft's Best Practice Analyzer ruleset (opens in a new tab).

Check a model for this Improve this page (opens in a new tab)