cancel
Showing results for
Did you mean:
Highlighted
mbriveroaks Frequent Visitor

## Calculate (subtract) total value result in Matrix visual with another value

Sorry for making a mockup data in excel. But I have column and row total in one Matrix visual (Actuals). Would like to calculate (Subtract) data from another dataset (Forcast). And get Delta (Actuals total - Forcast total)

Appreciate any help. 1 ACCEPTED SOLUTION

Accepted Solutions
Icey Member

## Re: Calculate (subtract) total value result in Matrix visual with another value

Hi @mbriveroaks,

If I understand correctly, you want to get the matrix visual like the screenshot below. If so, you can write your measures like so:

1. Create relationship between table ‘Actual’ and ‘Forcast’ based on Region.
2. Create measures like so:
```Actual Row Total =
SUMX ( Actual, Actual[Department 1] ) + SUMX ( Actual, Actual[Department 2] )

Forcast Row Total =
SUMX ( Forcast, Forcast[Department 1] )
+ SUMX ( Forcast, Forcast[Department 2] )

Forcast Row Total - Actual Row Total =
Forcast[Forcast Row Total] - Actual[Actual Row Total]```

Best Regards,

Icey Zhang

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

3 REPLIES 3
Icey Member

## Re: Calculate (subtract) total value result in Matrix visual with another value

Hi @mbriveroaks,

If I understand correctly, you want to get the matrix visual like the screenshot below. If so, you can write your measures like so:

1. Create relationship between table ‘Actual’ and ‘Forcast’ based on Region.
2. Create measures like so:
```Actual Row Total =
SUMX ( Actual, Actual[Department 1] ) + SUMX ( Actual, Actual[Department 2] )

Forcast Row Total =
SUMX ( Forcast, Forcast[Department 1] )
+ SUMX ( Forcast, Forcast[Department 2] )

Forcast Row Total - Actual Row Total =
Forcast[Forcast Row Total] - Actual[Actual Row Total]```

Best Regards,

Icey Zhang

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

mbriveroaks Frequent Visitor

## Re: Calculate (subtract) total value result in Matrix visual with another value

There is a relationship between both the tables via region

I just want to calculate difference between a fixed value (AOP Q4) & Matrix calculated values of Total (Actuals + Commits). But a simple formula in excel is a complicated one in PowerBI  Icey Member

## Re: Calculate (subtract) total value result in Matrix visual with another value

Hi @mbriveroaks ,

You can create your measure like so:

```Delta =
MAX ( 'Table 2'[AOP Q4] )
- ( MAX ( 'Table 1'[Actuals] ) + MAX ( 'Table 1'[Commits] ) )``` In this DAX expression, [Actuals], [Commits] and [AOP Q4] are all columns. If they are measures in your file, 'MAX' is not needed.

Best Regards,

Icey

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

Announcements #### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform. #### Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work Top Kudoed Authors
Users Online
Currently online: 191 members 1,991 guests
Recent signins:
• TheNov3mberist • Morsh • renanc • amas2010 • JSF24 • Tihannah • bstetson • jeffinord • rjaber • TracyEnglish • parasitoa • Jfasantos • blooney • huggy14392 