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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

How to calculate percent increase from last data to current data refresh.

Hi Everyone,

I want to show percent increase in sales but I want it to work in a way that whenever we do data refresh it calculate percent increase from last data refresh.

 

Please let me know how we can reslove this.


Thanks.

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi  @Anonymous 

Thanks for reaching out to us.

>> I want to show percent increase in sales but I want it to work in a way that whenever we do data refresh it calculate percent increase from last data refresh.

Usually we will get the time between two refreshes, then calculate the time interval between them, and then calculate the percentage of increase in sales.

For example,  

vxiaotang_0-1658740401188.png

Measure = 
var _3rdDate=MAXX(ALL('Table'),[date]) // last refresh date
var _2ndDate=MAXX(FILTER(ALL('Table'),'Table'[date]<_3rdDate),[date]) //this refresh date
var _diff= DATEDIFF(_2ndDate,_3rdDate,DAY)
var _2ndSale=SUMX(FILTER(ALL('Table'),'Table'[date]=_2ndDate),[sales])
var _3rdSale=SUMX(FILTER(ALL('Table'),'Table'[date]=_3rdDate),[sales])
return DIVIDE(_3rdSale-_2ndSale,_diff)

vxiaotang_1-1658742728308.png

Best Regards,

Community Support Team _Tang

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

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi  @Anonymous 

Thanks for reaching out to us.

>> I want to show percent increase in sales but I want it to work in a way that whenever we do data refresh it calculate percent increase from last data refresh.

Usually we will get the time between two refreshes, then calculate the time interval between them, and then calculate the percentage of increase in sales.

For example,  

vxiaotang_0-1658740401188.png

Measure = 
var _3rdDate=MAXX(ALL('Table'),[date]) // last refresh date
var _2ndDate=MAXX(FILTER(ALL('Table'),'Table'[date]<_3rdDate),[date]) //this refresh date
var _diff= DATEDIFF(_2ndDate,_3rdDate,DAY)
var _2ndSale=SUMX(FILTER(ALL('Table'),'Table'[date]=_2ndDate),[sales])
var _3rdSale=SUMX(FILTER(ALL('Table'),'Table'[date]=_3rdDate),[sales])
return DIVIDE(_3rdSale-_2ndSale,_diff)

vxiaotang_1-1658742728308.png

Best Regards,

Community Support Team _Tang

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

tamerj1
Super User
Super User

Hi @Anonymous 
I don't know how to retrieve the last update date but I will follow this post as big names are tagged here and surely interesting new information will flow through.

Anonymous
Not applicable

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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