cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FeroSK Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User
Super User

Re: Find last text value for groups by date

Hi @FeroSK 

 

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

 

2 REPLIES 2
Super User
Super User

Re: Find last text value for groups by date

Hi @FeroSK 

 

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

 

FeroSK Frequent Visitor
Frequent Visitor

Re: Find last text value for groups by date

Thank you very much! It works.

Now i have to find out how Smiley Happy

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 134 members 1,713 guests
Please welcome our newest community members: