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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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