SF logo
Power BI toolkit

Time Intelligence Builder

Pick your date table and the calculations you need (year to date, last year, growth, rolling 12 months and more) and get them as TMDL: measures for the measures you choose, one calculation group that works with every measure, or a trend of the last few months for a chart. No AI needed.

Step1

Your model export

The page finds your date table and measures in it and checks every name, so the script only refers to things that exist.

The model export query (the same one the other toolkit pages use)
  1. In Power BI Desktop, open DAX query view, paste this query and select Run.
  2. Above the results grid, select Copy, then paste below.
DAX query: model export

          
Step2

Your dates

Time intelligence needs a date table with one row per day for whole years, related to your facts. The Date Table Generator can build one.

The measures follow SQLBI’s standard time-related calculations pattern. The script adds hidden helpers to your date table: a DateWithSales column (TRUE up to the last date with data) and, for measures, a ShowValueForDates measure, so nothing shows after your data ends and last year stops at the same day.

Step3

Choose the calculations

Tick the calculations you want and rename them if you like. Percent calculations get the percent format; the others keep each measure’s own format.

Measures to build on

Step4

Test, then add it to your model

Checks run as you go. Run the test query to compare a few numbers with a visual, then apply the TMDL script.

Where new measures go

1. Test

DAX query: test

        

2. Add to the model (TMDL view)

TMDL script