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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Rup10
Resolver I
Resolver I

Sorting Weeknum,Year and month in direct query mode

Hi 

 

I have plotted cluster column chart by using year,month and weeknum as below : route timestamp.PNG

It is should come like jun25,jun 26, jul26 and jul27. I tried to sort data but it is giving me below error : 

sorting error.PNG

Can someone please help me with sorting.

 

Thanks in advance

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @Rup10 

 

The easiest way is to create an index column in pq, then use it as sort column in desktop.

Like this:

vjaneygmsft_0-1626156180184.png

 

Best regards

 

Janey guo

Community Support Team _ Janey
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@Rup10 , to sort you need to bring a column in the format YYYYWW.

 

Check if in direct query mode, you can add a new column like, if needed

 

Week sort = [Year]*100 +[Week]

 

mark that as sort column

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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