Forum Discussion

esclare's avatar
esclare
Frequent Visitor
7 years ago
Solved

get value based on max date and match

Hi, first post here.   I have 2 tables.   table1 ID_house  Value    Date 1                 200    01/02/2019 1                   50    01/01/2019 2                 100    02/02/2019 3      ...
  • AlB's avatar
    7 years ago

    Hi esclare 

     

    Try this for your new calculated column in Table2. See it working in this file

     

     

    NewColValue =
    VAR _MaxDate =
        CALCULATE (
            MAX ( Table1[Date] ),
            FILTER ( Table1, Table1[ID_House] = Table2[ID_House] )
        )
    RETURN
        LOOKUPVALUE (
            Table1[Value],
            Table1[Date], _MaxDate,
            Table1[ID_House], Table2[ID_House]
        )