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 August 31st. Request your voucher.

Reply
cliang
Frequent Visitor

Sort a text column by a date column, and get today's date

Hello all!

 

I have a table with two columns, 'Student Status' (Active, Leave, Repeat, Independent Study, etc.) and 'Start Date of Status'. 

'Start Date of Status' has future dates as well as past dates so I can't sort by latest date (because it would be in the future). 

I want to get the 'Student Status' according to the current date and show the date that the status started

 

When I try to Sort by column from 'Student Status' to 'Start Date of Status', it gives me an error of:

"We can't sort the 'Student Status' column by 'Start Date of Status'. There can't be more than one value in 'Start Date of Status' for the same value in 'Student Status'. Please choose a different column for sorting or update the data." 

 

Any help would be much appreciated!

-Christian

1 ACCEPTED SOLUTION
cliang
Frequent Visitor

I ended up finding a solution on YouTube for what I was looking for!

 

Here's the video for reference:

https://www.youtube.com/watch?v=hidJ5T_DYQ0

View solution in original post

4 REPLIES 4
cliang
Frequent Visitor

I ended up finding a solution on YouTube for what I was looking for!

 

Here's the video for reference:

https://www.youtube.com/watch?v=hidJ5T_DYQ0

v-zhangti
Community Support
Community Support

Hi, @cliang 

 

Is this the problem you are experiencing?

vzhangti_0-1667541466361.png

You can try the following methods.
Column:

Rank = RANKX(FILTER('Table',[Student ID]=EARLIER('Table'[Student ID])),[Start Date of Status],,DESC)

vzhangti_2-1667541729385.png

Sort the Student status columns in the order of the Rank column. Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Yes, that is the error I am experiencing.

 

And, no I don't think that's the result I am looking for. I'm trying to get the most recent status according to the current date. For example, today is 11/4/2022, I want to get the status according to 11/4/22. 

Hope this makes sense! Thank you for your help

Hi, @cliang 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with Excel. 

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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