Forum Discussion

nok's avatar
nok
Icon for Advocate II rankAdvocate II
11 months ago
Solved

Fetch value from another table where date is more recent

Hi! I have two tables that follow this structure: Orders ID       Amount AA 12 AA 88 BB 34 CC 90 CC 56 DD 23   History ID Status EditDate AA     Ok 23/0...
  • v-dineshya's avatar
    11 months ago

    Hi nok ,

    Thank you for reaching out to the Microsoft Community Forum.

     

    Please refer below Calculated column.

     

    Status =
    VAR latestDate =
        CALCULATE(
            MAX(History[EditDate]),
            FILTER(History, History[ID] = Orders[ID])
        )
    RETURN
        CALCULATE(
            MAX(History[Status]),
            FILTER(
                History,
                History[ID] = Orders[ID] &&
                History[EditDate] = latestDate
            )
        )
     
    Please refer output snap and attched PBIX file.
     

     

     

    I hope this information helps. Please do let us know if you have any further queries.

     

    Regards,

    Dinesh