Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Return Previous Value

Hi all,   I've been stuck on this for awhile and have browsed online, but I can't seem to figure it out! I have a table of unique IDs, dates, and statuses. I want to return the previous status for ...
  • ChrisMendoza's avatar
    7 years ago

    Anonymous -

    is 'Medium' an error? Does it not belong to [ID] = 3?


    Anonymous wrote:

     

    IDDateStatusPrevious Status
    11/1/2019Good 
    11/2/2019MediumGood
    11/3/2019BadMedium
    21/1/2019Bad 
    21/2/2019MediumBad
    21/3/2019MediumMedium
    31/1/2019Great 
    31/2/2019MediumGreat
    41/1/2019GoodMedium
    41/2/2019GreatGood
    41/3/2019GreatGreat
    41/4/2019MediumGreat

     


    This mostly works except for what I noted above:

    Column = 
    LOOKUPVALUE(
        'Table'[Status],
        'Table'[ID],'Table'[ID],
        'Table'[Date],'Table'[Date]-1
    )