Forum Discussion

cevangelista's avatar
cevangelista
Frequent Visitor
8 years ago
Solved

Find the Latest Value

Hi there, How can I find the latest value (Recruitment Stage)  for each ID number in the table below based on the Recruitment Stage date?   ID No Recruitment Stage Recruitment Stage Date 1...
  • TomMartens's avatar
    8 years ago

    Hey,

     

    i created a calculated column using this DAX statement:

    Is Latest = 
    var currentIDNo = 'Table1'[ID No]
    var latestDate = 
    CALCULATE(
        MAX('Table1'[Recruitment Stage Date])
        ,FILTER(ALL('Table1')
            ,'Table1'[ID No] = currentIDNo
        )
    )
    return
    IF('Table1'[Recruitment Stage Date] = latestDate, TRUE(), FALSE()) 

    Here is a screenshot of the result (my assumptuon: the Recruitment Stage Date is of data type datetime or date). Please be aware that my table shows other dates, this is due some date formatting issues :-) but nevertheless I can use the statement on your table:

     

    This column can now be used to filter the table.

     

    Hopefully this is what you are looking for.

     

    Regards

    Tom