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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.