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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Calculate Percentage Change/Difference Between Two Numbers With Formula

Capture.PNG

How To Calculate Percentage Change Or Difference Between Two Numbers In power bi?

The formula =(new_value-old_value)/old_value

 

1 ACCEPTED SOLUTION

@Anonymous , OR

 

new column =
var _max = maxx(filter(Table, [Index] <earlier([Index])), [Index])
var _value = minx(filter(Table, [Index] =_max), [Number])
return
divide([Number]-_value,_value)
//or use divide(_value-[Number],[Number])

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hello @Anonymous ,

 

You have to create two index columns in Power Query, sort the data first. An index starting from 0 and an index starting from 1. Then in a formula, you have to use the EARLIER function to perform the calculation in a calculated column.

Perecnt Change = (CALCULATE(SUM('Vendor (2)'[Number]),FILTER('Vendor (2)','Vendor (2)'[Index]=EARLIER('Vendor (2)'[Index.1])))-'Vendor (2)'[Number])/'Vendor (2)'[Number]

Krutigawale33_0-1616483037647.png

 

Anonymous
Not applicable

Please replace with a higher quality image of screenshot.

amitchandak
Super User
Super User

@Anonymous , You need add an index column in power query https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

and then add new column in dax

 

new column =
var _max = minx(filter(Table, [Index] >earlier([Index])), [Index])
var _value = minx(filter(Table, [Index] =_max), [Number])
return
divide(_value-[Number],[Number])

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

@Anonymous , OR

 

new column =
var _max = maxx(filter(Table, [Index] <earlier([Index])), [Index])
var _value = minx(filter(Table, [Index] =_max), [Number])
return
divide([Number]-_value,_value)
//or use divide(_value-[Number],[Number])

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.