Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Find last text value for groups by date

Hi all   I have table like this: index ID to stage end date Last Stage 1 aaa new 7/1/2019 Complete 2 aaa submitted 7/1/2019 Complete 3 aaa solutioning 7/3/2019 Complete...
  • Mariusz's avatar
    7 years ago

    Hi Anonymous 

     

    The below DAX expression should return the desired result.

     

    Last Stage = 
    VAR _lastIndex = CALCULATE( 
        MAX( 'Table'[index] ), 
        ALLEXCEPT( 'Table', 'Table'[ID] )
    )
    RETURN CALCULATE( 
        SELECTEDVALUE( 'Table'[to stage] ), 
        ALL( 'Table' ),
        'Table'[index] = _lastIndex 
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski