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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
robbert-bi
Frequent Visitor

How to let user sort matrix by specific months?

Hi. I have a matrix in Power BI with "Medewerker" in the Rows, "MMM-YYYY NL" (showing the month) in the columns and a measure called "% Declarabel" in the Values. See the screenshot for an example. The column "MMM-YYYY NL" comes from the table "Dim Date" and it contains the values jan-2025, feb-2025, mrt-2025, apr-2025, mei-2025, jun-2025, jul-2025, aug-2025, sep-2025, okt-2025, nov-2025 and dec-2025. I can sort the matrix based on the measure, but this only sorts the column which shows the totals. I would like to give the user the possibility to sort the values in the pivot from high to low (or the other way around) based on the month. This month should be selected by the user in a slicer. It is important that all months are always shown in the pivot. 

 

If I set the sorting of the matrix on the measure on "% Declarabel" then I can only sort on the total column. I know that instead of including one measure in the table I can create a separate measure for each month and that would fix the problem, but that is not how I want it as it is super inefficient. It is driving me crazy that I don't know how to fix this. Does anyone have some advice how to fix this and also keep just one measure in the matrix? 

 

robbertbi_0-1739877848285.png

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @robbert-bi 

Matrix can be sorted by the total column or by the row category.  Column category is sorted alphabetically in ascending order or by custom column sort. If you want to sort it by the total row, attached is a round about way to do it.

danextian_0-1739885608333.png

danextian_1-1739885623519.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @robbert-bi 

Matrix can be sorted by the total column or by the row category.  Column category is sorted alphabetically in ascending order or by custom column sort. If you want to sort it by the total row, attached is a round about way to do it.

danextian_0-1739885608333.png

danextian_1-1739885623519.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
nandic
Super User
Super User

@robbert-bi , you are correct. There is no default option in matrix visual to sort by specific column (month in your case).
As you already mentioned, adding measure/column for each month is not ideal solution.

Give a try to Zebra BI Tables custom visual. It gives allows you to sort by columns - just check if it requires paid license or that feature is free.
I think that also license is not that high on a yearly basis, worth checking.

Cheers,
Nemanja

amitchandak
Super User
Super User

@robbert-bi , Sort on Measure on column is not possible. But if you want desc sort on Month no. You can do it using sort column

Assume you have two column , Month Year, and Month year Sort to sort month year asc

 

You can create one

Month Year 1 = [Month Year]

Month Year Sort desc = rankx('Date', [Month Year Sort])

 

Now mark Month Year Sort desc as sort column for Month Year 1 and use that in visual

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak . Thanks for the response. I know how to sort the months. It is about sorting the values within the months, so on the vertical axis of my matrix.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.