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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Dax solution to calculate Spread or Diference

Hello, I need a solution that helps me calculate the difference between a measure that I created, based on a column I used the following formula to calculate the average of these values ​​when applying some filters on my dashboard
 
Average Ticker = 

AVERAGEX(

    KEEPFILTERS(VALUES('Vol Delta'[UndrlygInstrm])),

    CALCULATE(MEDIAN('Vol Delta'[VoltlyVal])))
 

 

After creating this measure I can create the following graph

 

 

EricAlves_0-1663179713801.png

 

 

After that I would like to create the measure that shows me the difference between these two values ​​​​in the graph

 

An example would be the red line with the value of 25.02% which would be the subtraction of 52.58 - 27.56

 

 

EricAlves_1-1663179856359.png

 

 

How can I make a formula to calculate this difference ?

EricAlves_2-1663179914108.png

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

Measure =
VAR _1 =
    CALCULATE (
        MAX ( 'Table'[VALUE] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[subject] = "B"
                && 'Table'[date] = SELECTEDVALUE ( 'Table'[date] )
        )
    )
RETURN
    _1 - MAX ( 'Table'[VALUE] )

vpollymsft_0-1663565373528.png

 

If I have misunderstood your meaning, please provide mor details with your desired and pbix file without privacy inofrmation.

 

Best Regards

Community Support Team _ Polly

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

Measure =
VAR _1 =
    CALCULATE (
        MAX ( 'Table'[VALUE] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[subject] = "B"
                && 'Table'[date] = SELECTEDVALUE ( 'Table'[date] )
        )
    )
RETURN
    _1 - MAX ( 'Table'[VALUE] )

vpollymsft_0-1663565373528.png

 

If I have misunderstood your meaning, please provide mor details with your desired and pbix file without privacy inofrmation.

 

Best Regards

Community Support Team _ Polly

 

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

Greg_Deckler
Community Champion
Community Champion

@Anonymous Well, you could create a measure that does a CALCULATE of that measure with a filter of your legend value and then your other legend value and average the two together. You may also find this helpful as this would be even easier to implement because the original average formula would not include that weird CALCULATE construct.

Better Average per Category - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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