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
Ramesh4321
Frequent Visitor

Week sorting issue

Hi All,

When i am trying to sort the week which contains year also(W1 2021) is not getting sorted properly as shown below

Ramesh4321_0-1650976755585.png

The expected output is W1 2021 W2 2021 W3 2021..... W1 2022 W2 2022 W3 2022....

Actual output is :as shown in above screenshort.

Kindly help me. Thanks in advance.

 

Regards,

Ramesh.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ramesh4321,

 

You need to create an index column for the [week_year] column. For example.

Index = YEAR('Table'[Date])*1000+WEEKNUM('Table'[Date])

Then select the [week_year] column and sort by index.

vcgaomsft_0-1651199097433.png

If the amount of data is large, you can use the SUMMARIZE function to create a summary table.

This is the table I used for testing.

vcgaomsft_1-1651199584195.png

This is the final sorting result.

vcgaomsft_2-1651199661240.png

Attached PBIX file for reference.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Ramesh4321,

 

You need to create an index column for the [week_year] column. For example.

Index = YEAR('Table'[Date])*1000+WEEKNUM('Table'[Date])

Then select the [week_year] column and sort by index.

vcgaomsft_0-1651199097433.png

If the amount of data is large, you can use the SUMMARIZE function to create a summary table.

This is the table I used for testing.

vcgaomsft_1-1651199584195.png

This is the final sorting result.

vcgaomsft_2-1651199661240.png

Attached PBIX file for reference.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

netanel
Post Prodigy
Post Prodigy

Hey @Ramesh4321 

 

There are several options for the solution

1. Search for three points in the right up corner in the visual "SORT by" and try to sort by week and not by year (assuming that DIM Date is correct or Date column)
2. Create an index column for the relevant columns and then do Sort by Index

 

If that does not help please share a file or more details and I will solve it for you

Goodluck!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

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.