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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
valentinphan
New Member

order a matrix

Hello,
I'm working on Power BI Report Server and I'm experiencing an issue when using a matrix visual.
I would like to sort my matrix in ascending or descending order, but it doesn’t seem to work.

Here is the structure of my matrix:

  • In the rows, I have clients (from a dimension table),

  • In the columns, I have a field called year_month (ex january 2025)

  • And in the values, I have a measure that calculates the revenue for the last 12 rolling months.

The issue is that I want to sort the columns representing the rolling months in ascending or descending order (for example: January, February, March), but it's not working as expected.
How can I make this sorting work?

Thank you in advance for your help.

1 ACCEPTED SOLUTION

Hi @valentinphan ,

As a workaround, you can try using a Table visual instead of a Matrix. The Table visual allows flexible sorting by any column, including values like revenue or specific months ,which can help achieve the sorting behavior you're looking for.

Hope this helps !

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

View solution in original post

8 REPLIES 8
v-aatheeque
Community Support
Community Support

Hi @valentinphan ,

Thanks for reaching to Microsoft Fabric Community Forum.

 

  • To display and sort monthly rolling revenue in a matrix visual, we used a DateTable with a YearMonth column (e.g., "Jan 2024") and sorted it using a numeric YearMonthNum column (e.g., 202401). This ensured chronological sorting of columns.
  • A DAX measure calculated the revenue over the last 12 months using DATESINPERIOD, allowing the matrix to show clients in rows and rolling months in columns with correct totals and order.

I am sharing the sample data file for better understanding with expected output : 

vaatheeque_0-1747974661386.png


If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

Thanks for using Microsoft Fabric Community Forum.




Thanks, that's what I did, but how can I sort the revenue by client for January 2024? I'd like client B to appear on the first row, for example. Actually, I want to be able to sort the revenue by client for each column in my matrix (by month). Normally, it's not possible to do that, and I'm trying to find an alternative.

Hi @valentinphan ,
for the above queries :

  1. To ensure that Client B appears in the first row of your matrix, you can create a custom sorting column in your data model. Here’s how you can do it:

      vaatheeque_0-1748240766497.png

2. Yes,Power BI's Matrix visual does not natively support sorting rows on a per-column basis (i.e., sorting by month).

 

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!



Is there no other solution (a workaround) to sort the months in ascending/descending order?

Hi @valentinphan ,

As a workaround, you can try using a Table visual instead of a Matrix. The Table visual allows flexible sorting by any column, including values like revenue or specific months ,which can help achieve the sorting behavior you're looking for.

Hope this helps !

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

Hi @valentinphan,

we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.

 If the response addressed by the community member for  your query, please mark it as Accept Answer and click Yes if you found it helpful.

 

Thank You.

 

Hi @valentinphan ,

If the information is helpful, please accept the answer by clicking the "Upvote" and "Accept Answer" on the post. If you are still facing any issue, please let us know in the comments. We are glad to help you.

 

We value your feedback, and it will help us to assist others who might have a similar query. Thank you for your contribution in enhancing Microsoft Fabric Community Forum.

Hi @valentinphan ,

Just checking in, We wanted to follow up on your question regarding sorting the matrix columns by rolling months in Power BI Report Server.

If you’ve found a solution that worked, we’d appreciate it if you could mark the response as "Accepted" and upvote it. This helps other users with similar issues find the solution more easily.

If you're still facing the issue or need further clarification, feel free to add a comment  we’re happy to assist further.

Thanks again for being part of the Microsoft Fabric Community and helping make it a more valuable space for everyone!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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