Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I am new to power bi and Dax. i am trying to return a previous value in a table. my data is similar to below:
Created Date | customer id | status | Reference | result I need | |
01/02/2022 | 1 | Progressed | 2 | ||
04/02/2022 | 1 | Active | 3 | 2 | |
03/02/2022 | 2 | progressed | 2 | ||
06/02/2022 | 3 | Active | 2 | ||
05/02/2022 | 4 | Progressed | 1 | ||
09/02/2022 | 4 | Active | 2 | 1 |
if a customer has both progressed and active in the status column i need to return the value for the progressed next to the active column so i can compare if it has increased/decreased.
Solved! Go to Solution.
@Anonymous ,
New column =
var _max = maxx(filter(Table, [Customer Id] = earlier( [Customer Id] ) && [Created Date] < earlier([Created Date]) ),[Created Date] )
return
maxx(filter(Table, [Customer Id] = earlier( [Customer Id] ) && [Created Date] = _max ),[Reference] )
@Anonymous ,
New column =
var _max = maxx(filter(Table, [Customer Id] = earlier( [Customer Id] ) && [Created Date] < earlier([Created Date]) ),[Created Date] )
return
maxx(filter(Table, [Customer Id] = earlier( [Customer Id] ) && [Created Date] = _max ),[Reference] )
Thank you, that appears to be working
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |