Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
akhaliq7
Continued Contributor
Continued Contributor

When to use Merging or Table Relationships

I have a issue whereby when I join two tables i get a many to many relationship. To avoid this is it better to merge the tables or the last time I had this issue I created an extra table with unique values. Linking the two tables to the extra table.

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Hi akhaliq7 

 

In the relationships screen you can edit the relationship.

But if your 2 tables do indeed containing many-to-many keys then it wont allow a 1 to many.

The usually workarround is to create a bridge tables.

Simply append the key columns from table1 with the key columns from table2 to create table3.
Remove duplicates from table3.

Then create 1:M relationship from table3 to table1   and table3 to table2 with bi-directional filtering.

When you filter table1 it will filter table2 and vice versa.

 

There are lots of you tube video on how to handle a many to many with a bridge table.

 

Or you can merge the two tables into one table with Power Query as you described.


Remember we are BI community voluntrees so please click the thumbs-up for me taking the trouble to help you and then accept the solution if it works.  Thank you !

 

 

 

 

 

View solution in original post

2 REPLIES 2
speedramps
Super User
Super User

Hi akhaliq7 

 

In the relationships screen you can edit the relationship.

But if your 2 tables do indeed containing many-to-many keys then it wont allow a 1 to many.

The usually workarround is to create a bridge tables.

Simply append the key columns from table1 with the key columns from table2 to create table3.
Remove duplicates from table3.

Then create 1:M relationship from table3 to table1   and table3 to table2 with bi-directional filtering.

When you filter table1 it will filter table2 and vice versa.

 

There are lots of you tube video on how to handle a many to many with a bridge table.

 

Or you can merge the two tables into one table with Power Query as you described.


Remember we are BI community voluntrees so please click the thumbs-up for me taking the trouble to help you and then accept the solution if it works.  Thank you !

 

 

 

 

 

akhaliq7
Continued Contributor
Continued Contributor

Thanks for taking out the time to write such a detailed response. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.