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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
theunissenp
Helper I
Helper I

Measure to calculate delta between selected planning version

Hi all,

 

I'm trying to create a measure that will calculate the delta between selected planning version. My simplified datamodel is as follows:

 

Versionvalue
Planning_110
Planning_220
Planning_325
Planning_48

 

Result should be usable in a matrix visual:

column1: planning version A

column2: planning version b

column 3: delta 

 

Thanks you very much for your respons!

 

Regards,

 

Paul Theunissen

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @theunissenp 

One idea,

vxiaotang_0-1654247424287.png

create the measure

Measure = 
var _count= COUNTX(ALLSELECTED('Table'[Version]),[Version])
var _max= IF(_count=2,MAXX(ALLSELECTED('Table'),'Table'[value]))
var _min= IF(_count=2,MINX(ALLSELECTED('Table'),'Table'[value]))
return
IF(HASONEVALUE('Table'[Version]),SUM('Table'[value]),_max-_min)

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

7 REPLIES 7
v-xiaotang
Community Support
Community Support

Hi @theunissenp 

One idea,

vxiaotang_0-1654247424287.png

create the measure

Measure = 
var _count= COUNTX(ALLSELECTED('Table'[Version]),[Version])
var _max= IF(_count=2,MAXX(ALLSELECTED('Table'),'Table'[value]))
var _min= IF(_count=2,MINX(ALLSELECTED('Table'),'Table'[value]))
return
IF(HASONEVALUE('Table'[Version]),SUM('Table'[value]),_max-_min)

 

Best Regards,

Community Support Team _Tang

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

Thanks! This helps a lot. One more question. Is it also possible to create a measure that calculates a difference for multiple dimension: Version, cost center and year, quarter and month?

example:

theunissenp_0-1655368497035.png

 

 

theunissenp
Helper I
Helper I

In the matrix the expected result shoud be:

when planing_1 and planning_2 are selected:

 

theunissenp_0-1654001128886.png

 

Hi:

I looked up a potential solution for you. Please check out this previous answer and I hope this helps!

 

https://community.powerbi.com/t5/Desktop/Compare-Data-based-on-2-selected-values-in-1-column/td-p/15...

Thanks for your help. Unfortunately this solution doesn't work for me... I get the message that I want to compare text with numbers

Whitewater100
Solution Sage
Solution Sage

Hi Paul:

 

Can you give sme examples of expected results? I'm not sure what you want to compare your selected value to? Thanks..

theunissenp_1-1655368561587.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors