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
aksharacoomar
Helper I
Helper I

Date Sort not working in Matrix

I am creating a table on PowerBI which reports on plans vs. actuals and needs to be broken out by year/quarter/month/week number/date. I have been successful in creating the table but the dates are somehow getting messed up. Please see my screenshot below -

aksharacoomar_3-1606838803189.png

 

The date is not getting sorted somehow - I tried to sort the table by date but it doesn't work. Please see my calendar table below to see how my date table is laid out- 

aksharacoomar_4-1606838869888.png

I want the dates to be sorted so the naming of the weeks can align correctly, for eg: June Wk5 should appear before July Wk1. The sort by column did not work for the data. Thank you in advance! 

 

1 ACCEPTED SOLUTION

Hi @aksharacoomar ,

 

Sort the month name using the month number.

Then create a "week num" column, and then sort the "week no" column by "week num" column.

 

weeknum = WEEKNUM(Sheet5[Date],1)

 

test_Date Sort not working in Matrix.PNGtest_Date Sort not working in Matrix2.PNG

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
DataInsights
Super User
Super User

@aksharacoomar,

 

You need to use "Sort by column" in the Data view. Click on the column to be sorted (Week no), click "Sort by column", and select the column to sort by (e.g., Week Number, data type = Whole number). You might rename "Week no" as "Week Name", to avoid confusion with "Week Number".

 

 

DataInsights_0-1606932562845.png

 





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

Proud to be a Super User!




aksharacoomar_0-1607056937886.png

@DataInsights I sorted the data as per your recommendation, yet the data is not sorting. I tried sorting the date column as well but the date column starts with July rather than January.

Do you know how I can fix this?

Hi @aksharacoomar ,

 

Sort the month name using the month number.

Then create a "week num" column, and then sort the "week no" column by "week num" column.

 

weeknum = WEEKNUM(Sheet5[Date],1)

 

test_Date Sort not working in Matrix.PNGtest_Date Sort not working in Matrix2.PNG

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey, thank you so much for your suggestion but unfortunately it didn't work. 

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.