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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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.

 

PowerBI-Delta.jpg

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous,

If I understand correctly, you want to get the matrix visual like the screenshot below.

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

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.

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Anonymous,

If I understand correctly, you want to get the matrix visual like the screenshot below.

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

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.

Anonymous
Not applicable

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 Smiley Indifferent 

 

PowerBI-Delta2.jpg

Icey
Community Support
Community Support

Hi @Anonymous ,

You can create your measure like so:

Delta =
MAX ( 'Table 2'[AOP Q4] )
    - ( MAX ( 'Table 1'[Actuals] ) + MAX ( 'Table 1'[Commits] ) )

Calculate (subtract) total value result in Matrix visual with another value - follow.PNG

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.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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