cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Frequent Visitor

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

 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%

1 ACCEPTED SOLUTION
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...

2 REPLIES 2
Frequent Visitor

it's an effective solution.

Thank you very much,

my friend,

thanks a lot,I LOVE YOU

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

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors