2021. dec 09.

Power BI Date Intelligence setup

írta: dataanalyticsdemo
Power BI Date Intelligence setup

Mistakes to avoid

For this to work, we need a Calendar table, or in another name a date table.

Why isn't one of our existing columns in our data good? Because:
-we need a table which contains all dates without skipping non-business days, holidays etc so all 365 days in a year.
-all the dates must occur only once (while in our tables multiple transactions can happen in a day or even none at all)

So let's create this table, the easiest was is through DAX calendarauto function. This will cover our dateframe which is existing in our dataset.

The main date column has to be set in DATE FORMAT. NOT DATETIME. Make sure you have in DATE format through any means necessary.

When this is done, you need to create the relationship between this, and your tables. This is done in a relatively easy way as well. Because our calendar table contains every date only once, this will be a many to one relationship type:

And now, for the magic formula. If all this is set up correctly, there are multiple DAX functions to chose from, we will cover PARALELLPERIOD today.

What NOT to do:

When  setting up this table, use the date dimension from the calendar/date table. DO NOT use the date dimensions of the original table because it will generate a mess like:

Not cool.
From here, you can get the awesome difference chart finally:

Does it work with multiple tables? I sure hope so. Let's try it out:

Let's just filter the existing table to some states and add it to the model. Create Measure and check

Everything seems to be working.

Szólj hozzá