Forum Discussion
Trouble with relationships on simple data model
- 6 years ago
Creating bridging table automatically:
1. Go to 'Modeling' tab in your pbi and click 'New Table'
2. write dax, I am assuming, your all tables names like, Table1, table2, Table3 and so on........ and ID field name is 'id'
UniqueAllids =
DISTINCT(UNION(
SELECTCOLUMNS(Table1,"id",Table1[id]),
SELECTCOLUMNS(Table2,"id",Table2[id]),
SELECTCOLUMNS(Table3,"id",Table3[id])
))3. Now you have all the unique IDs from all the tables, and try the relationship to all the tables, on the visual, drag fields from this table, so you can bring more fields to this table, above dax is just an example of one field, you can add more fields to this.
Let me know if you face any challenges.
Creating bridging table automatically:
1. Go to 'Modeling' tab in your pbi and click 'New Table'
2. write dax, I am assuming, your all tables names like, Table1, table2, Table3 and so on........ and ID field name is 'id'
UniqueAllids =
DISTINCT(
UNION(
SELECTCOLUMNS(Table1,"id",Table1[id]),
SELECTCOLUMNS(Table2,"id",Table2[id]),
SELECTCOLUMNS(Table3,"id",Table3[id])
))
3. Now you have all the unique IDs from all the tables, and try the relationship to all the tables, on the visual, drag fields from this table, so you can bring more fields to this table, above dax is just an example of one field, you can add more fields to this.
Let me know if you face any challenges.
Thank you! Very helpful