Forum Discussion
capko
Helper II
2 years agoLeft outer join with many to many relationship
I'm facing a problem with Power BI and a NATURALLEFTOUTERJOIN. I have two tables that I would like to join using a left outer join but I have a many to many relationship and the documentation says it...
Anthony_G1
1 year agoFrequent Visitor
FYI to future users who are reviewing this forum post, A bridge table in DAX worked!
TableOne - User_ID
TableTwo - User_ID
User_ID --> User_ID is a Many-to-Many relationship
So I created a DAX bridge table:
User_IDBridge =
DISTINCT(
UNION(
SELECTCOLUMNS(TableOne, "User_ID", TableOne[User_ID]),
SELECTCOLUMNS(TableTwo, "User_ID", TableTwo[User_ID]),
)
)
Then I created a one-to-many relationship from this bridge table to both TableOne and TableTwo, with "Cross-filter direction = Both" turned on for both relationships.
Lastly, I was now successfully able to create a join table:
Main_Reporting_Table = NATURALLEFTOUTERJOIN(TableOne, TableTwo)