Forum Discussion
Dynamically generate query tables
Facing a similar issue. Did you find any solution to this?
Hi Roshna. Unfortunately no, I didn't find a direct solution to this. As far as I know this isn't doable within Power BI, only if you actually have an external DB where you store your data, and then serve Power BI the different tables (and even then I'm guessing you'd still need to make a new query table to hold data from the different tables).
We did however solve this in a different way, which might be helpful to you depending on how similar your issue is to ours:
By pivoting / unpivoting the property columns and their values we've created a table Dim_EventProperties which has 3 columns Property ID, Property, Value - mapping each property to all it's possible values:
| Property ID | Property | Value | | 0 | A | x | | 1 | A | y | | 2 | B | z | | 3 | C | xyz |
We then have a bridge table between the events fact table, and the attached properties, eg. :
(Fact_UserAction) | ID | Action Name | Time | | 0 | ActionA | 05.08 | | 1 | ActionB | 05.08 | | 2 | ActionA | 04.08 | (Bridge_ActionToProperties) | Action ID | Property ID | | 0 | 0 | | 0 | 2 | | 1 | 3 | | 2 | 1 | | 2 | 2 |
In this way we can still map actions to many different properties, and we can still slice by different property names or values. It does make it slightly awkward to do so as it's not as easy to report on (but can be achieved if you set up you reports in a certain way). It also prevents you from looking at particular property uses depending on values of other properties (unless you start defining multiple similar tables, as if they were multiple dimensions).
TL : DR - No solution to the original issues, found a non-ideal work-around