Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
When the users are looking at event details they would like a simple selector for filtering on today/this week/this month/this year/all.
My idea is to create a column called "temporality" that associates each date with each of the 5 temporalities that would apply to it.
I will end up with a many-to-many relationship because each date can have several temporality (up to 5) and each temporality can be associated with several dates (up to 1000+ for the “all” temporality)
I thought I could create a simple lookup table called Calendar with all the dates that are present in the data.
This dataset has 2 columns: date and temporality. Each date is repeated across several lines(5 times for the today’s date, 4 times for the rest of the week, 3 times for the rest of the month…).
To bridge the Event table and the Calendar table I created an AllDates table that simply contains every date.
I can show the temporalities associated with each date and the events associated with each date.
It seems I can even filter on temporalities and only show the events associated with it.
But Power BI won’t let me show the temporalities associated with each event on the same grid.
How to solve that relationship issue?
NB: I guess I could pivot the Calendar table, then merge it with the Event table, then unpivot the temporality columns but then the table would become massive. That's why I'd rather go with a lightweight lookup table that would be used for the dates only...
NB: I'm not sure what differnce it actually makes but I set Cross filter direction to "both" for the 2 relationships
Solved! Go to Solution.
For this to work, you will have to use a measure in your grid. Unless you have a measure, you will keep getting this error message.
Try creating a simple measure like
Test = countrows(EventTable)
Then add Temporalitie, Event and the Test measure to a grid, and you should get the result.
Hey, you are right! That tricks work. It's like if we were forcing one of the table to be the fact table and then tadam it knows how to use the lookup tables to get the aditional details.
Thanks for the trick @SqlJason, you rock!
When you say that "Power BI won’t let me show the temporalities associated with each event on the same grid" what happens? Do you see an error on the grid?
I thought bi-directional filtering would let this work. Here's a great explanation about it: https://www.sqlbi.com/articles/many-to-many-relationships-in-power-bi-and-excel-2016/
when I try to create a grid with both events and temporality it gives the relationships error.
Which is strange, you are right, since it seems able to filter out events based upon temporality, so the relationship seems to be there somehow,
For this to work, you will have to use a measure in your grid. Unless you have a measure, you will keep getting this error message.
Try creating a simple measure like
Test = countrows(EventTable)
Then add Temporalitie, Event and the Test measure to a grid, and you should get the result.
Hey, you are right! That tricks work. It's like if we were forcing one of the table to be the fact table and then tadam it knows how to use the lookup tables to get the aditional details.
Thanks for the trick @SqlJason, you rock!
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
108 | |
106 | |
93 | |
69 |
User | Count |
---|---|
167 | |
132 | |
130 | |
96 | |
91 |