Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Salesman | Day | Sales volume | Day of growth |
Bill | 2021/1/1 | 536 | |
Bill | 2021/1/2 | 874 | 63.06% |
Bill | 2021/1/3 | 797 | -8.81% |
Bill | 2021/1/4 | 606 | -23.96% |
Bill | 2021/1/5 | 784 | 29.37% |
Bill | 2021/1/6 | 675 | -13.90% |
Bill | 2021/1/7 | 714 | 5.78% |
Bill | 2021/1/8 | 730 | 2.24% |
John | 2021/1/1 | 775 | |
John | 2021/1/2 | 519 | -33.03% |
John | 2021/1/3 | 794 | 52.99% |
John | 2021/1/4 | 958 | 20.65% |
John | 2021/1/5 | 548 | -42.80% |
John | 2021/1/6 | 944 | 72.26% |
John | 2021/1/7 | 655 | -30.61% |
John | 2021/1/8 | 656 | 0.15% |
Bob | 2021/1/1 | 867 | |
Bob | 2021/1/2 | 523 | -39.68% |
Bob | 2021/1/3 | 734 | 40.34% |
Bob | 2021/1/4 | 906 | 23.43% |
Bob | 2021/1/5 | 567 | -37.42% |
Bob | 2021/1/6 | 906 | 59.79% |
Bob | 2021/1/7 | 851 | -6.07% |
Bob | 2021/1/8 | 503 | -40.89% |
Solved! Go to Solution.
@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...
@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...
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
104 | |
99 | |
97 | |
41 | |
38 |
User | Count |
---|---|
151 | |
123 | |
79 | |
73 | |
71 |