Forum Discussion

Dimi_2207's avatar
Dimi_2207
Helper I
2 years ago
Solved

To show previous value based another column in DAX

Hello !   I have a big set of data and need to show in the column "Previous agent" the agent who took the previous call from the same phone number, please see the example below:   Date Phone ...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    2 years ago

    Hi,

    Write this calculated column formula

    Column = LOOKUPVALUE(Data[Agent],Data[Date],CALCULATE(MAX(Data[Date]),FILTER(Data,Data[Phone]=EARLIER(Data[Phone])&&Data[Date]<EARLIER(Data[Date]))),Data[Phone],Data[Phone])

    Hope this helps.