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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
rjsidek
Helper II
Helper II

Creating a 1-Many Relationship

Hi everyone,

 

I have a master table with an identifier which is the company name. I know that in my data model there will be multiple tables, so I would need to establish a realtionship. That said, in the master table, there are duplicates in the company name. As such, any relationship I create will be a Many-Many relationship, which I do not want.

 

As a workaround, I created a new table with just the company name and removed duplicates. However, when I tried to create a relationship between the 2 company name columns, the only option it allows me is to create a Many-Many relationship. 

 

Anybody know how I can get around to troubleshooting this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @rjsidek ,

You can consider using union, distinct, values functions to create a calculated table to extract and combine distinct value from original tables and use it as a bridge table to link the table with 'one to many' relationships.

Bridge =
DISTINCT ( UNION ( VALUES ( Table1[Column1] ), VALUES ( Table2[Column1] ) ) )

If above not work, can you please share some dummy data for test?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @rjsidek ,

You can consider using union, distinct, values functions to create a calculated table to extract and combine distinct value from original tables and use it as a bridge table to link the table with 'one to many' relationships.

Bridge =
DISTINCT ( UNION ( VALUES ( Table1[Column1] ), VALUES ( Table2[Column1] ) ) )

If above not work, can you please share some dummy data for test?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

This did the trick, thank you! but I still find it weird cause I removed duplicates but still did not have all distinct values, which is weird

tex628
Community Champion
Community Champion

First make sure that there are no duplicates in your distinct table:

Select the data-view:
image.png

Select the correct table and column, at the bottom left of the screen the following information should be displayed:
image.png

As you can se here my lndex column that is selected has the same amount of distinct values as the total number of rows in the table. This means that the column is completly unique. 

Check this and then get back to me! 🙂 

Br,
J


Connect on LinkedIn

Hi @tex628 

 

I checked it, and you were right! It seems that I have 438 rows but only 436 distinct values. I tried to remove dupicates in power query but it is still giving me the same result. Managed to find one of the duplicates, but I cannot for the life of me find the other one. Is there a way to do like conditional formatting to highlight duplicates in powerbi?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors