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! Learn more

Reply
Dlahey
Helper I
Helper I

Calculate Absolute Change Y-o-Y

Hi All,

 

I am sure this is simple - I cannot seem to figure it out.

I have created a calculation to divide Dollars by Units to give me an Average Selling Price.

 

How can I create a formula to calculate the absolute change between my calculation for Y-o-Y.

 

For Ex: 2021 Average Selling Price = $335 and 2020 = $407 the result should show an absolute change Y-o-Y of -$72.

How can I build a DAX query to calculate this?

 

Thanks very much,

Dave

1 ACCEPTED SOLUTION

Hi @Dlahey ,

 

Has the following measure without using the time intelligence functions been tried? Does it return the correct value? If it is still wrong, please provide your sample data.

 

Measure = 
var _YTD = 
    CALCULATE(
        [Average Selling Price - Consolidated],
        FILTER(
            ALLSELECTED( Working_Days ), 
            year( Working_Days[Reference Date] ) = YEAR( TODAY() )
        )
    )
var LYTD = 
    CALCULATE(
        [Average Selling Price - Consolidated],
        FILTER(
            ALLSELECTED( Working_Days ), 
            year( Working_Days[Reference Date] ) = YEAR( TODAY() ) - 1
        )
    )    
return _YTD - LYTD

vkkfmsft_0-1640594833252.png

Best Regards,
Winniz

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

3 REPLIES 3
Dlahey
Helper I
Helper I

thank you - I have tried this and it doesn't seem to give me the desired output

 

ASP Consolidated LYTD = calculate('Calculated Table'[Average Selling Price - Consolidated],DATESYTD(dateadd(Working_Days[Reference Date].[Date],-1,Year),"12/31"))
 
ASP Consolidated YTD = calculate('Calculated Table'[Average Selling Price - Consolidated],datesytd(Working_Days[Reference Date].[Date],"12/31"))
 
the output shows as -$335 instead of -$72

Hi @Dlahey ,

 

Has the following measure without using the time intelligence functions been tried? Does it return the correct value? If it is still wrong, please provide your sample data.

 

Measure = 
var _YTD = 
    CALCULATE(
        [Average Selling Price - Consolidated],
        FILTER(
            ALLSELECTED( Working_Days ), 
            year( Working_Days[Reference Date] ) = YEAR( TODAY() )
        )
    )
var LYTD = 
    CALCULATE(
        [Average Selling Price - Consolidated],
        FILTER(
            ALLSELECTED( Working_Days ), 
            year( Working_Days[Reference Date] ) = YEAR( TODAY() ) - 1
        )
    )    
return _YTD - LYTD

vkkfmsft_0-1640594833252.png

Best Regards,
Winniz

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

 

 

 

amitchandak
Super User
Super User

@Dlahey , Assume you have Average Selling Price

 

YTD Sales = CALCULATE([Average Selling Price],DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE([Average Selling Price],DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.