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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Finding the last value of the column with filter

Hi everyone, I have one problem and hope that can get your help to solve this one. As you can see below, I want to show the last station name of each workpiece if they finish in that station. Example: the result show be the "Rein" station. But the result somehow is always the station with alphabetically sorting. Even I did it with the DAX or in the visuallization, it was still alphabetically sorting. Could anyone help me with this? Thank you.

 

3.png

1 ACCEPTED SOLUTION
pranit828
Community Champion
Community Champion

Hi @Anonymous 

 

You can start by getting the Max of the Station_end_date for each WorkpieceID and then select the StationName at that time.

Column :

Current Station =

var MAX_DT = CALCULATE(MAX(PA[Station_end_date], ALLEXCEPT(PA,PA[WorkpieceID]))

return CALCULATE(MAXX(FILTER(PA,PA[Station_end_date]=MAX_DT),PA[StationName]), ALLEXCEPT(PA,PA[WorkpieceID]))

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Regards,
Pranit

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

View solution in original post

2 REPLIES 2
pranit828
Community Champion
Community Champion

Hi @Anonymous 

 

You can start by getting the Max of the Station_end_date for each WorkpieceID and then select the StationName at that time.

Column :

Current Station =

var MAX_DT = CALCULATE(MAX(PA[Station_end_date], ALLEXCEPT(PA,PA[WorkpieceID]))

return CALCULATE(MAXX(FILTER(PA,PA[Station_end_date]=MAX_DT),PA[StationName]), ALLEXCEPT(PA,PA[WorkpieceID]))

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Regards,
Pranit

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
amitchandak
Super User
Super User

@Anonymous , Can you share sample data and sample output in table format?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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