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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Sorting dates in query editor

Hi, 

I am having trouble sorting from newest-oldest for a date column in query editor. I know that I can sort it when I get out of the editor, but I want an applied step that sorts the dates. When I sort by descending, it puts the dates like this: 8/30/2019, 7/30/2020, 6/30/2016, 5/30/2020 (just an example). It sorts the dates based off of the first number rather than the actual date. 

 

Please let me know how I can solve this issue because I need it to be a step in the query because I need to add steps after that rely on the dates being sorted from newest to oldest.

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

On the home tab in the query editor, there is a Sort button in the center of the ribbon.  Just highlight the column to sort and then choose the sort order.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
Vickchan
Regular Visitor

I did Sort button in the center of the ribbon in query editor, but it was wrong sorting in Data view after refresh. how to fix it?

amitchandak
Super User
Super User

@Anonymous , Is this column is date or text column. Because in case it is date column desc sort should work properly.

 

On visual there are three dots .., you can go and change visual level sort.

 

In case it is a text column you can define a sort column and mark that as sort column.

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
mahoneypat
Microsoft Employee
Microsoft Employee

On the home tab in the query editor, there is a Sort button in the center of the ribbon.  Just highlight the column to sort and then choose the sort order.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thank you @mahoneypat . For some reason, if I use the drop down at the top of the column to sort the dates, it does it incorrectly. However, if I use the sort tab on the home page, it works how it should. Thank you!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.