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

Sorting Matrix rows - this should be easy

Hi, It must be me being daft but to me this should be easy... I have a pre-existing matrix in a report that someone else created and i am trying to change the sort order. The attached screenshot shows the three fields and their sources, i've also attached the relationships if its relevant.. But no matter what i change in the "Data" view "Sort By" column, it remains sorted by "channel" alphabetically .. I want it sorted by the year column numerically. I do have a date column in the same table that is not shown in the matrix and I have tried sorting by that but the matrix doesnt change at all no matter what I do -

 

What am I doing wrong ?

Where do i go to see what it is currently sorting by and how do I change it ?

 

sorry if this is a simple quesiton

 

davidlittle_0-1667001204253.png 

davidlittle_2-1667001417552.png

 

 

 

1 ACCEPTED SOLUTION

@davidlittle ,

 

Yes if it's from the same dimension (table). If you want it by Year and Month then you should replace those two columns with a Month-Year column and have that column sorted by your Date field. If you don't already have a column for that, it could easily be created by adding a new calculated column:

 

Mnth-Year = FORMAT([Date], "MMM YYYY")


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

4 REPLIES 4
hnguy71
Memorable Member
Memorable Member

Hi @davidlittle ,

 

Select the matrix visual, click the three-dots at the top right, and click Sort By and click your Year column:

 

hnguy71_0-1667001743968.png

 

If that doesn't work, try changing your year from a text to a number.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

@hnguy71 Thankyou for quick reply! this allows me to sort it numerically by year which works and is brilliant thankyou but I overlooked this doesnt sort  by the other columns ? By which I mean the data is grouped by year and month, so ideally i want it sorted by year, then month - can I add "tierd" sorting ?

@davidlittle ,

 

Yes if it's from the same dimension (table). If you want it by Year and Month then you should replace those two columns with a Month-Year column and have that column sorted by your Date field. If you don't already have a column for that, it could easily be created by adding a new calculated column:

 

Mnth-Year = FORMAT([Date], "MMM YYYY")


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Aha,  I added the column you mention but couldnt set "sort by" date on it as the date column had multiple values per month year grouping (as it would do) BUT building in your solution i added a calculated sort coulmn and then sorted the visual by that ! so thank you very much for your solution as it allowed me to fix it it!

 

Mnth-Year-sort = VALUE(Dates[Calendar Year] & "00") + Dates[Calendar Month]

 

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.