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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Avinash_Sah
Regular Visitor

Getting many-to-many relationship even when one of the column created is using DISTINCT Need 1toMany

Their is a table with a column having something like this:

 

DISTINCT(UNION(ALL('table1'[col_name1]),ALL('table2'[col_name2])))

 

And I want to create relationship to another table using the same column.
It should be 1-to-many as it is having distinct entries. But instead it is giving many-to-many.
It don't know why it is so.

 

There is data like: 
1. Dog
2. Dogs
3. Cat
4. Cats

Maybe that "...s" in the end is causing issue. I don't know facing this for the first time.

1 ACCEPTED SOLUTION

It was Null values that was causing the issue, removing them from edit query option did the thing. Your solution also looks like it would work.

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Avinash_Sah 

I'm wondering if it has something to do with the blank row a model adds to a table for missing relationships.  ALL grabs that row.  Try it like this.

DISTINCT(UNION(DISTINCT('table1'[col_name1]),DISTINCT('table2'[col_name2])))

DISTINCT will not pull the blank row from the source tables.

It was Null values that was causing the issue, removing them from edit query option did the thing. Your solution also looks like it would work.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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