Best Practices With Dates in PowerBI
Best Practices With Dates in PowerBI
Best practices
with dates
in PowerBI
Downloadable free
resources to practice
in GitHub
1 Create a table of dates in DAX
→ The table: « DimDate »
This step is one of the first things to do when you create a PowerBI
project. With this step, PowerBI validates your date system and
allows optimal operation with the “Time Intelligence” functions.
On the « table
view »
Path: «Table tools >
Mark as date
table »
This tip is really usefull when you want to have a good ascending sorting
of dates; the days and months in particular.
Before After
4 Create a “relative Month”
→ Also usefull with days, weeks…
This tip is really useful for your users (and also for your measures). It
allows to display only the month with sales data in the filter. In the
example below we have sales until March 15, 2024. So why to show to the
users the entire month of the year as well as subsequent years? In the
table of dates, create a calculated column and write the Dax formula below.
→ Explanation: The month of march 2024 will have the value “O (zero)”,
and before march 2024 the months will have a negative value (the past) and
positive value after march 2024 (the future). After that we put this value
in the pane filter of the “report view” and put the settings showing below.
Before After
5 Create hierarchy of date
This tip will allow you to group your main dates information and use it
simultaneously in your tables or charts. This will also make it easier
for your users to understand.
Before After
6 Create short month
It can be useful to have only the first letter of each month, especially
when you have charts in a small space. See Tip 1 for lines reference.
→ Explanation: On line 7 of the table date code (see Tip 1), we take the first
letter (LEFT) of each month in capital (UPPER).
→ Explanation: In English, for example, the first letter of a month, "J", can
be January, June or July. It is important to distinguish them if we want to
order them (as Tip 4) chronologically. It depends on the language of the
country. So, for the second "J" we put a space (" ") and 2 spaces (" ") for
the third "J“ to have different values.
7 Performance optimization
This tip will allow you to avoid having a model whose size can really
increase more and more. Also this tip will improve its performance.
Path: File > Options and settings > Options > Data Load > Time intelligence
Unselect “Auto
date/time”
Don’t forget!
This isn't the truth, it's just my truth!
Patou Tips
Follow me
Like me
Share me