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

Why is many to one relationship actually works as many to zero relationship?

I have two tables.

Table a: a list the vessel ID I am interested in. ID is the unique key

Table b:

unique_idunique key for each row
b_idvesselid 
b_namereport type name
b_cntreport count

 

These two tables has a many to one relationship. Each vessel id in table b can have more than one report.

relationship.png

 

Below I simple pull raw data from a and b for you to have a better understanding of these two tables.

raw data.png

Then in the left table below, I pull out id from both a and b. It is strange that for id in B that does not have a corresponding value in a, they are still shown. In right table below, I do a distinct count of id in a and b. Yes, there are 27 distinct ids in a and 84 in b. But they are joint now. There is a many to one relationship. The row in b that does not have a corresponding value in a should be filtered out. I am expecting both to show 27 in the right table below.

sum.png

 

What is many to one relationship? Many to one means, for each row in table b, there HAS to be 'one and only one' corresponding row in table a. Now the model in POwer BI actually works as a many to zero relationship, not many to one.

 

Also if I want to show only vessels that are in a, I need to add a filter saying 'id in a is not blank'?

sum2.png

1 ACCEPTED SOLUTION

@yf569 

 

You may take a look at Relationship evaluation.

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@yf569 , issue No very clear to me.

By Default is right outer. So if B has value A will start showing null, You have to suppress A's null value

I didn't not see any document from Microsoft saying it is right join though...

 

What is not clear? So if B has value, and A does not, but A still shows null, then it is zero to many relationship, not one to many.  

@yf569 

 

You may take a look at Relationship evaluation.

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.