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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Calculate the difference between two columns in a multi level matrix

 

Here is the source data:

 

1.PNG

 

Here are the potential values:

 

2.PNG

 

Here is the output matrix in Power BI:

 

3.PNG

Here are the Power BI Visualizations and Fields:

 

4.PNG

 

I would like to create a measure to calculate the difference between Version 1 and 2 like this (Columns E and H):

 

5.PNG

 

Note: This report will change version and quarter filters so the Delta needs to recalcultate.  Thanks for any help!

3 REPLIES 3
amitchandak
Super User
Super User

Create three measure Sales V1, Sales v2 and Diff and use them?

 

V1 = calculate(sum(sales), version ="V1")
V2 = calculate(sum(sales), version ="V2")
Diff = V2-V1

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

This works great if I only have V1 and V2.   However, I need it dynamic.  What if I have 10 versions and need to compare sales in V2 vs V5?  This could end up requiring 20+ calculation columns, any idea how to get around this?

Create 2 version table. Join both of them with main table with disabled join. The create formula using userelation  and then subract.

 

Use both slicer in UI.

How to use userelation, check

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors