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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Custom sort on rows and columns in Power BI Matrix

In order to apply custom sort on rows and columns in Power BI Matrix, I'm using fields from separate sort tables in the matrix visuals. However, I'm unable to apply any filter on that matrix using field from the base table.
Is there any workaround for this, if not a functionality?

@amitchandak @AlexisOlson 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1637914263895.png

Matrix visual object:

vyangliumsft_1-1637914263896.png

Custom rules:

Columns in the order of A-C-B-D

Lines are in the order of January – February – March – April

Here are the steps you can follow:

1. Enter the power query, select Add Column – Column From Examples – From All Columns.

vyangliumsft_2-1637914263898.png

First create [Column]

vyangliumsft_3-1637914263900.png

Then create [Row]:

vyangliumsft_4-1637914263902.png

Get the data:

vyangliumsft_5-1637914263903.png

2. Select [group], click Column tools – Sort by – [Column]

vyangliumsft_6-1637914263905.png

3. Select [Month], click Column tools – Sort by – [Row]

vyangliumsft_7-1637914263907.png

4. Result:

vyangliumsft_8-1637914263908.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1637914263895.png

Matrix visual object:

vyangliumsft_1-1637914263896.png

Custom rules:

Columns in the order of A-C-B-D

Lines are in the order of January – February – March – April

Here are the steps you can follow:

1. Enter the power query, select Add Column – Column From Examples – From All Columns.

vyangliumsft_2-1637914263898.png

First create [Column]

vyangliumsft_3-1637914263900.png

Then create [Row]:

vyangliumsft_4-1637914263902.png

Get the data:

vyangliumsft_5-1637914263903.png

2. Select [group], click Column tools – Sort by – [Column]

vyangliumsft_6-1637914263905.png

3. Select [Month], click Column tools – Sort by – [Row]

vyangliumsft_7-1637914263907.png

4. Result:

vyangliumsft_8-1637914263908.png

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@Anonymous , Matrix sort as of now can be done on the basis Ascending order of the column or the sort column. Not on measure as of now.

 

Their new feature was added to sort legend in Nov 2021- But I doubt that can help in matrix , https://powerbi.microsoft.com/en-us/blog/power-bi-november-2021-feature-summary/

 

Desc sort on the column of the matrix, I discussed here

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.