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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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

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

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.

Anonymous
Not applicable

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

 

 

Anonymous
Not applicable

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

Anonymous
Not applicable

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

Anonymous
Not applicable

theunissenp_1-1655368561587.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.