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

 

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...

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.