Forum Discussion
Trying to get Previous Status from Status column to compare with Current Status
- 8 years ago
Hi rohanmate,
You can create a calculated column below:
Previous Status = var t=CALCULATE(MAX('Table1'[ID]),FILTER('Table1','Table1'[ID]<EARLIER(Table1[ID])&& Table1[Project Name]=EARLIER(Table1[Project Name])))
return
LOOKUPVALUE(Table1[Status],Table1[ID],t)Best Regards,
Qiuyun Yu
Hi rohanmate,
You can create a calculated column below:
Previous Status = var t=CALCULATE(MAX('Table1'[ID]),FILTER('Table1','Table1'[ID]<EARLIER(Table1[ID])&& Table1[Project Name]=EARLIER(Table1[Project Name])))
return
LOOKUPVALUE(Table1[Status],Table1[ID],t)
Best Regards,
Qiuyun Yu
I got the previous Status working by your formula, but I cant see Current status logic or column in the pbix file attached. Please can you help me with getting current status (Where it should give the status by most latest date logged for project name.... Basically it should return only one value)
Thank you in advance,
Rohan
- Ashish_Mathur8 years agoSuper User
Hi,
My solution gives you the previous and current status. Did you try that?
- rohanmate8 years agoAdvocate II
Hi Ashish_Mathur,
I am still not following your directions, Is there any way you could paste the current and previous formula you used in your file and paste it here ?
Thanks
Rohan
- Ashish_Mathur8 years agoSuper User
Hi,
Used these measures
Most recent date = MAX(Data[Date])
Previous date = CALCULATE(MAX(Data[Date]),DATESBETWEEN(Data[Date],MINX(ALL(Data[Date]),Data[Date]),[Most recent date]-1))
Current Status = LOOKUPVALUE(Data[Status],Data[Date],[Most recent date],Data[Project Name],VALUES(Data[Project Name]))
Previous status = LOOKUPVALUE(Data[Status],Data[Date],[Previous date],Data[Project Name],VALUES(Data[Project Name]))
Please also read my previous posts carefully.