Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |