Stop 10 · Time IntelligenceTopics · 1/9

Why Time Intelligence Needs a Date Table

Part of the Power BI Roadmap

In short

"This year vs last year" is the most common question in any review meeting. Power BI's time functions answer it in one line, but only if they have a proper calendar to walk along.

Time intelligence functions need a continuous date table with every day in each year covered, marked as a date table and related to your facts. Gaps or text dates give wrong answers.

The jaadu holds a wall calendar with several pages torn out in one hand and a complete, thick calendar in the other, looking relieved at the full one.

Think of it like this

The wall calendar with torn pages

Imagine counting "30 days back from today" on a calendar where someone tore out every Sunday and the Diwali week. You'd land on the wrong date. Your Sales table is that torn calendar: it only has days when something was sold. A date table is the complete calendar, every single day, so counting back always lands correctly.

Watch it happen

Fact table dates vs a proper date table

Sales[OrderDate]

  • Only days with orders
  • Gaps on holidays and closed days
  • Repeats the same date many times
  • Time functions can return incomplete periods

'Date'[Date]

  • One row for every day
  • Full years, no gaps
  • Holds Year, Month, Fiscal Year columns
  • Marked as a date table and related to Sales

Always point time intelligence at the date column of a marked date table, never at a date in your fact table.

The big ideas

What you need to know

Every day, no gaps

Time functions shift and expand ranges of dates. They need each day present between the first and last date.

Cover full years

Start on the first day of a year and end on the last day, for example 1 April 2023 to 31 March 2027 for Indian fiscal years.

Mark it

Mark as date table tells Power BI which column is the calendar key and lets time functions work reliably on it.

Turn off Auto date/time

Auto date/time creates hidden date tables for every date column. Switch it off in Options once you have your own.

How it works

What a valid date table needs

  1. 1

    A Date type column

    Real dates, not text like "05-04-2026" that looks like a date.

  2. 2

    Unique values

    One row per day, never repeated.

  3. 3

    No blanks or gaps

    Every day from start to end is present.

  4. 4

    Related to facts

    A one-to-many relationship from 'Date'[Date] to Sales[OrderDate].

See it in code

Walk through the code

dax
1-- Risky: walks along the fact table's own dates2Sales PY (Risky) =3CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( Sales[OrderDate] ) )4 5-- Reliable: walks along the complete, marked date table6Sales PY =7CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )8 9-- Health check: TRUE when there are no missing days10Date Table Is Complete =11COUNTROWS ( ALL ( 'Date'[Date] ) )12    = DATEDIFF ( MIN ( 'Date'[Date] ), MAX ( 'Date'[Date] ), DAY ) + 1

1/3Uses the dates that happen to exist in Sales. Missing days and filters from other tables can give odd results.

Same function, two date columns. Only the second is safe for real reports.

Save yourself the pain

Common mistakes

Oops

Keeping dates as text because they came from a CSV that way.

Do this instead

Change the type to Date in Power Query. Text dates sort alphabetically and don't work with time functions.

Oops

Building the date table only from the first to the last order date, like 17 Jun 2024 to 9 Nov 2026.

Do this instead

Extend it to full years so year-level comparisons have complete periods on both sides.

Your mission

Spot the torn calendar

~15 min

Quick check

Which is NOT a requirement for marking a table as a date table?

Go deeper

  1. 1Check your date table covers full years with no missing days.
  2. 2Use date columns from the date table, not the fact table, in visuals.
  3. 3Confirm the relationship uses a Date-type column on both sides.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge