Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Find last text value for groups by date

Hi all

 

I have table like this:

indexIDto stageend dateLast Stage
1aaanew7/1/2019Complete
2aaasubmitted7/1/2019Complete
3aaasolutioning7/3/2019Complete
4aaaaccepted7/5/2019Complete
5aaaComplete7/6/2019Complete
6bbbnew7/10/2019Cancelled
7bbbsubmitted7/11/2019Cancelled
8bbbsolutioning7/13/2019Cancelled
9bbbCancelled7/13/2019Cancelled
10cccnew7/20/2019solutioning
11cccsubmitted7/21/2019solutioning
12cccsolutioning7/22/2019solutioning

 

I need a new calculated column Last Stage with information of ID's groups last stage.

Can someone help me with this?

Thank You.

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

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

 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

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

 

Anonymous
Not applicable

Thank you very much! It works.

Now i have to find out how 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.