Forum Discussion
matheus
4 years agoNew Member
Dimensions and Facts table
I have a big fact table that have multiple columns with the same type of data. From what I understand reading the star schema doc (https://docs.microsoft.com/en-us/power-bi/guidance/star-schema), I w...
- 4 years ago
For something this I think the best thing would be to unpivot those value columns in power query. Then you'd have something like:
ID Year ValueNumber Value 2 2022 1 1 2 2022 2 0 2 2022 3 1 2 2022 4 1 2 2022 5 2 2022 6 0 3 2021 1 1 Then you only need to join the dimension table to one column, and for measures/visual you could then filter by ValueNumber to see the different values for each.
AntonioM
4 years agoSolution Sage
For something this I think the best thing would be to unpivot those value columns in power query. Then you'd have something like:
| ID | Year | ValueNumber | Value |
| 2 | 2022 | 1 | 1 |
| 2 | 2022 | 2 | 0 |
| 2 | 2022 | 3 | 1 |
| 2 | 2022 | 4 | 1 |
| 2 | 2022 | 5 | |
| 2 | 2022 | 6 | 0 |
| 3 | 2021 | 1 | 1 |
Then you only need to join the dimension table to one column, and for measures/visual you could then filter by ValueNumber to see the different values for each.