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
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
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.