Forum Discussion
Calculate the difference between two columns in a multi level matrix
Here is the source data:
Here are the potential values:
Here is the output matrix in Power BI:
Here are the Power BI Visualizations and Fields:
I would like to create a measure to calculate the difference between Version 1 and 2 like this (Columns E and H):
Note: This report will change version and quarter filters so the Delta needs to recalcultate. Thanks for any help!
3 Replies
- amitchandakSuper 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-V1Appreciate 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-with-Winners/ba-p/890814
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601- AnonymousNot 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?
- amitchandakSuper User
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