Forum Discussion

Victormar's avatar
Victormar
Icon for Helper V rankHelper V
4 years ago
Solved

Return a value based on a condition

Hi community,   So I have a table with columns refering to measurements we are registering, and also the same amount of columns refering the measure with IsLatest, no show which is the last measure...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Victormar ,

     

    From my understanding, you want to create a IsLatest column.

    You could create a measure like

    IsLatest =
    VAR _MAX =
        MAXX (
            FILTER ( ALL ( 'Table' ), [VALUE] <> BLANK () && [ID] = MAX ( 'Table'[ID] ) ),
            [DATE]
        )
    RETURN
        IF (
            _MAX = MAX ( 'Table'[DATE] ),
            1,
            IF ( SUM ( 'Table'[VALUE] ) <> BLANK (), 0 )
        )
    

     

     

     

    Best Regards,

    Stephen Tao

     

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