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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SH-VE
Helper IV
Helper IV

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
Employee
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

Thanks a lot , It worked.

View solution in original post

2 REPLIES 2
mahoneypat
Employee
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


Thanks a lot , It worked.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors