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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sanshushu
Frequent Visitor

I have a problem to ask for your help, my friend.

I have a problem to ask for your help, my friend.

 

like this table,

 


If this row and the previous row are the same salesperson, calculate the current and previous day's growth rate, if this row and the previous row are not the same, return null.


How do I write this function? Use the DAX function.


I'm sorry that my English is very poor, so I can only describe it through translation tools.

Thank you for your answer.

 

 

SalesmanDaySales volume Day of growth
Bill2021/1/1536 
Bill2021/1/287463.06%
Bill2021/1/3797-8.81%
Bill2021/1/4606-23.96%
Bill2021/1/578429.37%
Bill2021/1/6675-13.90%
Bill2021/1/77145.78%
Bill2021/1/87302.24%
John2021/1/1775 
John2021/1/2519-33.03%
John2021/1/379452.99%
John2021/1/495820.65%
John2021/1/5548-42.80%
John2021/1/694472.26%
John2021/1/7655-30.61%
John2021/1/86560.15%
Bob2021/1/1867 
Bob2021/1/2523-39.68%
Bob2021/1/373440.34%
Bob2021/1/490623.43%
Bob2021/1/5567-37.42%
Bob2021/1/690659.79%
Bob2021/1/7851-6.07%
Bob2021/1/8503-40.89%

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sanshushu , Try a new column

 

new column =
var _max = maxx(filter(Table, [salesman] = earlier([salesman]) && [Day] < earlier([Day]) ), [Day])
var _vol = maxx(filter(Table, [salesman] = earlier([salesman]) && [Day] =_max ) ), [Sales volume])
return
if(isblank(_max), blank() , divide([Sales volume]-_vol,_vol))

 

 

refer for more options

 

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

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

2 REPLIES 2
sanshushu
Frequent Visitor

 
 
      
 

it's an effective solution.

Thank you very much,

my friend,

thanks a lot,I LOVE YOU

amitchandak
Super User
Super User

@sanshushu , Try a new column

 

new column =
var _max = maxx(filter(Table, [salesman] = earlier([salesman]) && [Day] < earlier([Day]) ), [Day])
var _vol = maxx(filter(Table, [salesman] = earlier([salesman]) && [Day] =_max ) ), [Sales volume])
return
if(isblank(_max), blank() , divide([Sales volume]-_vol,_vol))

 

 

refer for more options

 

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

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