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
Lucky_Zia
New Member

Incorrect Total Calculation in nested measures

Hi,

I have the following measure that is doing wrong calculation

 

 

SummerizeConsumption =
VAR _Table = SUMMARIZE('Chips Consuption Query','Chips Consuption Query'[Component.Component Level 01.Key])
RETURN SUMX(_Table,[Consumption])

 

 

here measure formula for [Consumption]

 

 

[Consumption]=
var Val1 = CALCULATE(SUMX(
VALUES('Parent Consumption Query'[Component.Component Level 01.Key]), IF('Parent Consumption Query'[Component.Component Level 01.Key] IN { "P1","P2","P3","P4","P5" }, 'Parent Consumption Query'[Parent Issue Stock Qty.]) ))
var val2 = CALCULATE(SUMX(
VALUES('Parent Production Query'[Material.Material Level 01.Key]), IF('Parent Production Query'[Material.Material Level 01.Key] IN { "P1","P2","P3","P4","P5" }, 'Parent Production Query'[Parent Production Qty.]) ))
RETURN DIVIDE(Val1,val2)
'Parent Consumption Query'[Parent Issue Stock Qty.]= SUM('Parent Consumption Query'[Issue Total Stock])
'Parent Production Query'[Parent Production Qty.] =SUM('Parent Production Query'[Activity quantity])

 

 

My issue is that SummerizeConsumption is not calculating total correctly as shown below

Capture 1.JPG

 

 

 

1 REPLY 1
_Moosa
New Member

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.