Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

return previous value in a calculated column

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 Datecustomer idstatusReferenceresult I need
01/02/20221Progressed2  
04/02/20221Active3 2
03/02/20222progressed2  
06/02/20223Active2  
05/02/20224Progressed1  
09/02/20224Active2 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.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@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] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you, that appears to be working

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.