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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Dealing with many to many relationship

HI ,

I need help on one to many relationship.

I three tables : 

  1. Table 1 - FRS Hold Rls Date
  2. Table 2 - FRS Hold Measures
  3. Table 3- FRS Inventory Measures, and following is how they are joined.

SH-VE_0-1613595187994.png

 

This is a mock re-creation of the type of data fields and data in the three tables

SH-VE_3-1613595425235.png

I need to create a table listing RLS Date and (1) Count of Steel ID (2) Total weight against Steel ID. Although Count of ID is giving the correct result , the weight is not showing correct total. It will be great help if the forum can advise why am I getting the total of all weight for each RLS Date and not the total against each date. How can we resolve this. 

This is how it looks like currently.

 

SH-VE_6-1613595876943.png

Thanks.

 

 

 

2 ACCEPTED SOLUTIONS
mahoneypat
Microsoft Employee
Microsoft Employee

Your Date and Hold Measures are not filtering your Inventory measures table.  You can pass the SteelID values over to that table with TREATAS.  See if this gets your expected result.

 

New Sum = CALCULATE(SUM(Table3[Weight]), TREATAS(VALUES(Table2[SteelID]), Table3[SteelID]))

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Anonymous
Not applicable

Thanks a lot , It worked.

View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Your Date and Hold Measures are not filtering your Inventory measures table.  You can pass the SteelID values over to that table with TREATAS.  See if this gets your expected result.

 

New Sum = CALCULATE(SUM(Table3[Weight]), TREATAS(VALUES(Table2[SteelID]), Table3[SteelID]))

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks a lot , It worked.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors