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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
theunissenp
Helper I
Helper I

Calculate positive and negative delta

Dear all,

 

I am trying to calculate a delta between selected planning versions. I am able to calculate the absolute delta but i am not able to calculate if this delta is a negative or possitive deviation.

 

Used measure:

Delta =
VAR SelectedVersionVALUES('Planned_version'[Planning version])
VAR MinvalueMINX(
    SelectedVersion,
    CALCULATE(
        [Planned value]))
VAR Maxvulue=
    MAXX(SelectedVersion,
    CALCULATE(
        [Planned value]))
VAR Difference =
IF(Maxvulue > Minvalue,
(Maxvulue-Minvalue)*-1,Maxvulue-Minvalue)
RETURN
    Difference
   Desired result:
Product 12Delta
city bike102010
Cross bike400-40
Mountain bike205030
Race bike505-45

Current result

Product 12Delta
city bike102010
Cross bike40040
Mountain bike205030
Race bike50545

 

SAmple PBIX is attached. 

 

thanks for your comments

 

Regards,

 

Paul

Sample PBIX 

 

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1666114442675.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thanks for your reply. The problem is this solution is that de planning version is selected by a slicer. In the example data there are only 2 but in real life a new version is created every day.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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