Forum Discussion

jak8282's avatar
jak8282
Helper III
3 years ago
Solved

Get value against max date

Hi,

 

I have a table like follows

DateNameOutcome
21/09/2022bobfail
23/09/2022bobpass
24/09/2022bobfail
21/09/2022jennypass
   
   
   

 

I want to have a table which return the latest outcome

 

NameOutcome
bobFail
jennypass
  
  
  • Hi jak8282 
    Please try this measure:

    Latest Outcome =
    VAR LatestDate = CALCULATE(
        MAX('Table'[Date]),
        ALLEXCEPT('Table', 'Table'[Name])
    )
    RETURN
    CALCULATE(
        VALUES('Table'[Outcome]),
        'Table'[Date] = LatestDate,
        'Table'[Name] = SELECTEDVALUE('Table'[Name])
    )

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly 



1 Reply

  • Hi jak8282 
    Please try this measure:

    Latest Outcome =
    VAR LatestDate = CALCULATE(
        MAX('Table'[Date]),
        ALLEXCEPT('Table', 'Table'[Name])
    )
    RETURN
    CALCULATE(
        VALUES('Table'[Outcome]),
        'Table'[Date] = LatestDate,
        'Table'[Name] = SELECTEDVALUE('Table'[Name])
    )

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly