01.4Add a date table
Your flat table works. Yet it is missing a piece as soon as you want a running total since the start of the year, or to compare one period with another.
01.4.1Time intelligence functions
Power BI offers functions that calculate over periods, like a running total since January 1 or the revenue of the previous year. They are called time intelligence functions.
For example, TOTALYTD calculates a running total since the start of the year. A measure that uses it is written like this:Revenue Since January = TOTALYTD( [Revenue], Calendar[Date] )
On the March 2025 row of a visual, TOTALYTD adds up the sales from January 1 to March 31, 2025, that is 200,000, 150,000 and 150,000. The measure returns 500,000.
01.4.2A calendar with no missing day
These functions need a complete date table, one row per day, without a single missing day. The Date column of your sales won’t do, because it lacks every day without a sale.
So in Power BI, you add a date table, often called Calendar. You then link it to the Date column of the flat table.
| Date | Year | Month Name |
|---|---|---|
| 1/1/2024 | 2024 | January |
| 1/2/2024 | 2024 | January |
| 1/3/2024 | 2024 | January |
| 1/4/2024 | 2024 | January |
| 1/5/2024 | 2024 | January |
| 1/6/2024 | 2024 | January |
| 1/7/2024 | 2024 | January |
| 1/8/2024 | 2024 | January |
| 1/9/2024 | 2024 | January |
| 1/10/2024 | 2024 | January |
| 1/11/2024 | 2024 | January |
| 1/12/2024 | 2024 | January |
| 1/13/2024 | 2024 | January |
| 1/14/2024 | 2024 | January |
| 1/15/2024 | 2024 | January |
| 1/16/2024 | 2024 | January |
| 1/17/2024 | 2024 | January |
| 1/18/2024 | 2024 | January |
| 1/19/2024 | 2024 | January |
| 1/20/2024 | 2024 | January |
| 1/21/2024 | 2024 | January |
| 1/22/2024 | 2024 | January |
| 1/23/2024 | 2024 | January |
| 1/24/2024 | 2024 | January |
This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.
It covers 2024 and 2025 day by day, which makes 731 rows, while the sales have only 12.
How to create this table and link it is shown later, when you split the flat table in Power Query.
Without a date table, these functions rely on incomplete dates, and their results become hard to predict. If one day your running total since January stays blank or looks wrong, your formula isn’t necessarily to blame. Check the date table and its relationship with the sales first. If your running total or your previous month stays blank, the Diagnostic walks you through it step by step.
Quiz
The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.
Question 1
A visual by month shows the measure TOTALYTD( [Revenue], Calendar[Date] ). What does the May 2025 row show?
Question 2
How many rows does a complete date table covering only the year 2025 have?
Question 3
On January 2, 2024, the dealership sold nothing. Where do you find this date?
- Time intelligence functions, like TOTALYTD, calculate over periods.
- They need a complete date table, one row per day, with no missing day.
- You add this table in Power BI and link it to the Date column of the flat table.