Forum Discussion

astarkey's avatar
astarkey
Frequent Visitor
8 years ago
Solved

Return a Value based upon date in another column

This seems like it would be straight forward but I can't seem to put my finger on a solution....   I have similar to this in a table...   Equip ID      Meter Reading     Date Of Reading abc123  ...
  • Zubair_Muhammad's avatar
    8 years ago

    astarkey

     

    Try this MEASURE

     

    LastMeterReading =
    VAR last_date =
        MAX ( TableName[ Date Of Reading] )
    RETURN
        CALCULATE (
            FIRSTNONBLANK ( TableName[Meter Reading   ], 1 ),
            FILTER (
                ALLEXCEPT ( TableName, TableName[Equip ID] ),
                TableName[ Date Of Reading] = last_date
            )
        )