Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 19 | |
| 11 | |
| 10 |