In my operational database, the tables are structured in such a way that each object has its own ID and the relationship between objects are stored in another tabes called as relation tabe.
Essentially, the relation table contained a parent child relationship. I added an extra column in it called as PATH, that I can use to traverse through the relations.
So the tables are City, State, Country and Continent.
City:
State
Country
Continent:
Most Important is this table which shows the path
table_REL
Question : What is the best way to model this kind of structure in Power BI?
The below obviously doesnt work the best.
Shall I make a bridge table and then link the Table_Rel to each dimension? Has anyone come across such modelling ?
Hi @Sachy123 ,
The bridging table approach is considered the best practice when relating two dimensions.
Many-to-many relationship guidance
You can rebuild the metadata of the table in PQ to create a snowflake model:
Continent(1)(Continent_ID) --> (*)Country(1)(Country_ID) --> (*)State(1)(State_ID) -->(*)City
Understand star schema and the importance for Power BI
Parsing Organizational Hierarchy or Chart of Accounts in Power BI with Parent-child Functions in DAX
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
User | Count |
---|---|
105 | |
77 | |
72 | |
48 | |
47 |
User | Count |
---|---|
158 | |
86 | |
80 | |
68 | |
66 |