Forum Discussion
Anonymous
2 years agoNot applicable
Relationships between groups
Hey, I have a data set looking like screenshot following, but I have met a wall, and I know this is simple cut cannot conceptualise this: In my set, an order can come from several sources: adwor...
- 2 years ago
Anonymous so you should unpivot the data by following these steps:
Transform Data -> Select Order id and pK_Date columns -> Right click -> Unpivot other columns
It will add two columns, attribute and value, rename as you want it, close, and apply.
Now set the relationship from the dim table to the attribute column in the fact table and that's it. Now you should be able to slicer the fact table from the dim table
parry2k
Super User
2 years agoAnonymous not sure what is the shape of your fact tables. Can you share? It should be unpivoted if it is not already.
Anonymous
2 years agoNot applicable
Hey parry2k , it looks just like that, plus some columns. the flags from_adwords, from_blogger etc are a result of SQL modifications at the source (in power query I put a sql script)
| OrderID | PK_Date | from_adwords | from_blogger | from_cc | from_mail | from_organic | |
| 11899222 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899243 | 02/06/2024 00:00 | 1 | 0 | 1 | 1 | 0 | |
| 11899245 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899777 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899806 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899873 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899878 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899884 | 02/06/2024 00:00 | 1 | 0 | 0 | 0 | 0 | |
| 11899898 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899903 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899956 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899989 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11899995 | 02/06/2024 00:00 | 0 | 0 | 0 | 1 | 0 | |
| 11900036 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 | |
| 11900072 | 02/06/2024 00:00 | 1 | 0 | 0 | 1 | 0 |
|