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
KamalK
Regular Visitor

Sum product 2 table filtered on 2 indirect relations

Hi,

 

I try to create a measure that multiples the red figures (Sum(Production[Quantity])*Norms[Plan (manhours/piece)]) but they are not directly linked

Capture.JPG

 

For each row in Production table, there is only 1 norm 'Plan (manhours/piece)' for that specific product and specific machine. I need to sum the 'Quantity' multiplied by the right norm each time. I try to mix calculate, sumx and cross filtering but can't even get a multiplication into it.

 

Any idea how to approach this?
.

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @KamalK 

 

You may try the following measure to see if it helps.

SUMX(
     ADDCOLUMNS( 
       SUMMARIZE(
               CROSSJOIN(
                  DISTINCT(Products[Product ID]),
                  DISTINCT(Machines[Machine ID])
               ),
               Products[Product ID],
               Machines[Machine ID],
       ),
       "RESULT",
       CALCULATE(SUM(Norms[Plan (Man hours/piece)]))*CALCULATE(SUM(Production[Quantity])),
     )
     [RESULT]
)

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=Sumx(Summarize(Generate(VALUES(Products[Product ID]),VALUES(Machines[Machine ID])),Products[Product ID],Machines[Machine ID],"Total",Norms[Plan (Man hours/Piece)]*Production[Quantity]),[Total])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Employee
Employee

Hard to know w/o the model to try it on, but I think this measure will work for you.

 

NewMeasure =
SUMX (
VALUES ( Norms[Product ID] ),
VAR currentproductID =
CALCULATE ( MIN ( Norms[Product ID] ) )
VAR manhours =
CALCULATE (
SUM ( Norms[Plan (Man hours/piece))) Var qty = Calculate(SUM(Production[Quantity] ),
Production[Product ID] = currentproductID
)
RETURN
manhours * qty
)

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

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


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.