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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors