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

View all the Fabric Data Days sessions on demand. View schedule

Reply
user35131
Helper III
Helper III

How to create a measure that gives me the % of change for every previous year from select or viewed?

I would like to create a measure that gives me the % of change of the select year from the previous. 

 

The formula is 

 

(old value-new value)/old value. The example I have is (1933-1604)/1933 which is 17.02. 

 

However this is fairly simple to do. I used this formula 

 

YTD= DIVIDE([Data (ytd)]-Data[(lytd],Data[(lytd])
 
I have a measure that takes all the years and I was able to create a line graph showing them all using this formula
 
All Years YTD = VAR YearsBack = YEAR(TODAY())- SELECTEDVALUE(Years[Year]) RETURN CALCULATE([Data (ytd)],DATEADD(Dates[Date],-YearsBack,YEAR))
 
user35131_0-1638218016241.png

 

 
However is there a way to get a measure to add the percentage of change to the previous year. I am able to do it when i have two years, but i would like to include in all the lines i have shown in previous graph. 
 
user35131_1-1638218276171.png

 

 
If I hover on 2021, i will get the difference % between 2020 and 2021. If i hover on 2020, i will get the difference % between 2019 and 2020. For 2019, it'll be 2019 and 2018. Then so on. 
 
I want to create a Year Difference on top of this
 
4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Share your source data and show the expected result in a Table format.  Once we get the correct numbers in a Table format, we can create any graph we want. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Unfortunately the table is made up of measures and concealed data. Thank you. I'll try to replicate and see how it goes. 

AllisonKennedy
Super User
Super User

@user35131 I'm not sure what you mean - it sounds like you already have the % difference with your YTD measure? 

 

Can you provide screenshots or images/more detail?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy Hey i added some pictures that might be helpful. Let meknow. The one with multiple lines is good and visually how i want it to look, but when i hover i went it to be like in the second photo, but just for each line. Note that i have the year change for when I have two seperate files. I want the year to year change within the measure. Rather than have a seperate 2020 and 2021 file, i have a measure that includies 2020, 2021,2019, 2018 and so on. 

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.

Top Solution Authors
Top Kudoed Authors