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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JasiExpert
Regular Visitor

Measure (Multiply 2 columns from different tables) correct on lowest level but totals are too high

I am a beginner, just had a 2 days training and started with my first projects. Now I am facing the following problem. I want to multiply 2 columns from 2 different tables.  The Measure "PlanBedarfStk" (#2 ist just another try) shows the correct value per item but the moment I select more than 1 item the totals are too high (calculation seems to happen on higher level). 

powerBiHelp.png

Table "PlanStkVK" (only relevant columns) 

ArtikelNr(itemNr)MonthPlanStk (planned pcs)
abc-123452021/015
abc-123452021/020
abc-123552021/013

 

Table "vw_aevo_Stückliste_mPreis" shows all the elements required to produce the items 

ArtikelNrElementNrMenge (pcs)MEK (price)MengexMek (calculated column)
abc-12345bcd-123452050010.000
abc-12345bxs-456232510250
abc-12355xcv-567891022220

 

I guess the problem is the relation between the 2 tables (m:n).

Any ideas how i can solve this.

Finally I want to calculate the total costs of production (MengexMek) x (planned pieces).

But (Menge x planned pieces) already doesnt show correct figures if more than one item is selected.

 

Thanks a lot to the experts.

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

In general, (a + b + c) * (x + y + z) = a*x + a*y + a*z + b*x + b*y + b*z + c*x + c*y + c*z is not the same as a*x + b*y + c*z. I suspect you want the latter but your attempts are written like the former.

 

It's not completely clear to me how all your data tables are related so it's hard to say exactly, but you should be able to get the result you want using SUMX a bit like this:

_PlanBedarfStk =
SUMX ( VALUES ( vw_aevo[ArtikelNr] ), [_PlanStk] * [_MEKxStk] )

 

View solution in original post

2 REPLIES 2
JasiExpert
Regular Visitor

Thank you soo much. 

powerBiHelp_solved.png

AlexisOlson
Super User
Super User

In general, (a + b + c) * (x + y + z) = a*x + a*y + a*z + b*x + b*y + b*z + c*x + c*y + c*z is not the same as a*x + b*y + c*z. I suspect you want the latter but your attempts are written like the former.

 

It's not completely clear to me how all your data tables are related so it's hard to say exactly, but you should be able to get the result you want using SUMX a bit like this:

_PlanBedarfStk =
SUMX ( VALUES ( vw_aevo[ArtikelNr] ), [_PlanStk] * [_MEKxStk] )

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.