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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.