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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
FVP
Helper I
Helper I

Ranking YYYY_W notation correctly (2022_6 is ranked between 2022_52 and 2022_7)

Hi all,


I'm having trouble finding a solution for what seems like a simple fix. I have export file that uses a date notation of YYYY_W. 

For example:
2022_1 (Being year 2022, week 1)

2022_2

2022_3

2022_4

2022_5
2022_6

2022_52 (being year 2022 and week 52)



The issue is that when I use this data, it ranks it as follows:

2022_1 

2022_2

2022_3

2022_4

2022_5

2022_52
2022_6

 

How can I change the ranking so that it ranks correctly?

Thanks for all the help 🙂



1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @FVP,

In fact, they are text values so they will be sorted by text characters instead of the numbers.

Perhaps you can add a new column to your table to convert the year week as numeric values,(year *100 +week number) then you can set the new field as ‘sort by column’ of the text field to help raw table fields work with customize sort orders.

Regards,

Xiaoxin Sheng

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

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @FVP,

In fact, they are text values so they will be sorted by text characters instead of the numbers.

Perhaps you can add a new column to your table to convert the year week as numeric values,(year *100 +week number) then you can set the new field as ‘sort by column’ of the text field to help raw table fields work with customize sort orders.

Regards,

Xiaoxin Sheng

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

Hi @v-shex-msft 

Sorry for my late reply. This solution works, and makes a lot of sense. 
Thanks for your reply and time 🙂

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.