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
dombarg
Helper II
Helper II

how to create many to many relationship with two duplicated columns in Power Bi Desktop

hello my frinds.

i got a problem in my data model design.

i have two tables in whitch there are two duplicated columns.how can I create a bridge table (if is neccesary) to handle this issues?

thanks.

following pictures are a screenshot of those tables

Table 1 Table 2

 

as u see, city codes and years are those two column i've said.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Here's an idea.  Using Query Editor, append the City column from both datasets and then remove duplicates.  Save this new one column table as Cities.  Do the same for Years as well.  Then create a relationship.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Here's an idea.  Using Query Editor, append the City column from both datasets and then remove duplicates.  Save this new one column table as Cities.  Do the same for Years as well.  Then create a relationship.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

Well, you could create a new column in each, CityYear that combines those values. Then you would just need a bridge table that has all of the distinct values from those columns.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

thank u.very creative solution.i've used this for other problem.

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.