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
jasonjklim
Frequent Visitor

Subtract a top row value to another row from Matrix

I am trying to establish a matrix table in PBI. 

One of the calculation is subtracting a top row value to another row from a matrix.

 

For example, 

 

jasonjklim_1-1683317600630.png

 

 

I used DAX to do the samething. 

 

 

 

Drivers value2 = 
VAR production =
calculate(sum('Summary Data'[Value])/1000000,
    'Expense Roll up Mapping'[Expense Layer 3] ="Production Labor")
var adl2 =
    calculate(sum('Summary Data'[Value])/1000000,
    'Expense Roll up Mapping'[Expense Layer 3] ="Associate Domestic Labor",
    ALL('Summary Data'[New BU])
    )
var adl =
    calculate(sum('Summary Data'[Value])/1000000,
    'Summary Data'[Expense RollUp_P&L] ="Associate Domestic Labor"
    )
return
    SWITCH(SELECTEDVALUE('Expense Roll up Mapping'[Expense Layer 3]),
    "Production Labor", IF(ISBLANK(production),0, production), 
    "Associate Domestic Labor",  IF(ISBLANK(adl2-production), 0 ,adl2-production))

 

 

 

 

However, the result is the following:

jasonjklim_0-1683317335184.png

 

I guess that in matrix, my Associate Domestic Labor row in expense layer 3 can't subtract different rows' values, production from the same table.

Is there any way that I can get this?

 

Please advise.

 

Thank you.

   
   
   
0 REPLIES 0

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.