Forum Discussion

Mediviz's avatar
Mediviz
Frequent Visitor
5 years ago
Solved

select the last value saved by item

Hi everyone Below I have a table with dates and scores by name.   Nom Date Score AAA 01.01.2021   1540 AAA 02.01.2021    1640 AAA 03.01.2021    1753 AAA 04.01.2021         ...
  • ERD's avatar
    5 years ago

    Hi Mediviz ,

    You can try this measure:

     

    MaxValuePerNom = 
    VAR currNom = SELECTEDVALUE ( T[Nom] )
    VAR maxDate = MAXX ( FILTER ( ALL ( T ), T[Nom] = currNom ), T[Date] )
    RETURN
        IF (
            SELECTEDVALUE ( T[Date] ) = maxDate,
            CALCULATE ( MAX ( T[Score] ), T[Nom] = currNom, Table15[Date] = maxDate )
        )

     

     

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

  • Icey's avatar
    5 years ago

    Hi Mediviz ,

     

    Try this:

    Measure filter =
    VAR LastDate_ =
        CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Nom] ) )
    RETURN
        IF ( MAX ( 'Table'[Date] ) = LastDate_, 1 )
    

     

     

    Best Regards,

    Icey

     

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