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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
stoneluo
Regular Visitor

Sort time interval in chronological order

Hi, I am trying to sort some time intervals in a slicer. They each represent a week, yet they are in a very strange order. I think PBI interprets them as text instead of time interval, so each number is sorted like characters.

 

I want to sort them in chronological order. I think based on the first date should be good enough. May I ask how I can do that? Thank you!

stoneluo_1-1643654266988.png

 

 

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @stoneluo ,

I used some of your values (not all) and tried to simulate your issue. I think I came to a solution.

From this slicer here....

tomfox_0-1643664425612.png

 

...I was able to sort them and ended up with this:

tomfox_1-1643664614908.png

 

I first created a new column in power query where I parsed all the values before the delimeter "-" of the interval column, ending up with the dates in text format. I then changed the type of the new column to date. Finally, I used the "sort by" function to order the intervals by the new column as seen in the link of the previous answer.

 

Hope this helps!


/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

2 REPLIES 2
tackytechtom
Super User
Super User

Hi @stoneluo ,

I used some of your values (not all) and tried to simulate your issue. I think I came to a solution.

From this slicer here....

tomfox_0-1643664425612.png

 

...I was able to sort them and ended up with this:

tomfox_1-1643664614908.png

 

I first created a new column in power query where I parsed all the values before the delimeter "-" of the interval column, ending up with the dates in text format. I then changed the type of the new column to date. Finally, I used the "sort by" function to order the intervals by the new column as seen in the link of the previous answer.

 

Hope this helps!


/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

freginier
Super User
Super User

Hi you can't sort your column with another column. 

- First column (in your slicer) contain start and end of week

- Second column contain start of week and you sort on it

 

May help you 

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

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.