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
Anonymous
Not applicable

Final total should be subtracted

Dear

 

I have table with below value

 

DESC               Budget                   VALUE                Month

XXXX               Budget - 2019         2000                  1

XXXX               Actual-2019            1000                   1

YYYY                Budget-2019           5000                  1

YYYY               Actual-2019             3000

 

When I use the Matrix visualization , It show me as

DESC      Actual-2019       Budget-2019           Pending amount

XXXX       1000                  2000                        3000    (THis value should difference of "Budget-2019 - Actual-2019" means this must show as 1000)

YYYY        3000                  5000                        8000   (this should show the diff of Budget-2019-Actual-2019  means 5000-3000=2000)

 

Can any one tell how show the difference value

 

diff.PNG

HERE the total should be diff of Budget-2019 and Actual-2019.

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

You can create a measure using DAX below and drag the measure to the value field of the matrix.

Difference = 
VAR Current_DESC = MAX('Table'[DESC])
VAR Budget_Value = CALCULATE(MAX('Table'[VALUE]), FILTER('Table', 'Table'[DESC] = Current_DESC && 'Table'[Budget] = "Budget-2019"))
VAR Actual_Value = CALCULATE(MAX('Table'[VALUE]), FILTER('Table', 'Table'[DESC] = Current_DESC && 'Table'[Budget] = "Actual-2019"))
RETURN
ABS(Budget_Value - Actual_Value)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

You can create a measure using DAX below and drag the measure to the value field of the matrix.

Difference = 
VAR Current_DESC = MAX('Table'[DESC])
VAR Budget_Value = CALCULATE(MAX('Table'[VALUE]), FILTER('Table', 'Table'[DESC] = Current_DESC && 'Table'[Budget] = "Budget-2019"))
VAR Actual_Value = CALCULATE(MAX('Table'[VALUE]), FILTER('Table', 'Table'[DESC] = Current_DESC && 'Table'[Budget] = "Actual-2019"))
RETURN
ABS(Budget_Value - Actual_Value)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

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.