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
Anonymous
Not applicable

Sorting values in certain order -Matrix Visual

Hi,

I have a Matrix visual, want to sort the values that appear in certain way as in which value to be displayed first, second and third and not based on Totals(numeric column) or alphabetical sort(For text based column) . Is there any way where i can define the values based on a particular requirement ?

Eg. I have the below chart, I want to sort both ROWHEADING1 and ROWHEADING2 but not as alphabetical order. I want to have BBB value to appear first again inside BBB I want to have DEF value to be appeared first,followed by ABC, then GHI. How to achieve this?

shreyoogp_1-1649987177571.png

Kindly appreciate your help

Thank you

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want.

1. Create sort order dimension tables as below screenshot using Enter Data method

yingyinr_0-1650344767412.png

2. Create the relationships between dimension tables and fact table

yingyinr_1-1650344855497.png

3. Apply the fields in the dimension tables onto the matrix and sort ROWHEADING1 and ROWHEADING2 by column: Sort order

yingyinr_2-1650344928651.png

In addition, you can refer the following links to get it.

Sort one column by another column in Power BI

Sort a Column with a Custom Order in Power BI

yingyinr_3-1650345084174.png

Power BI - Custom Sorting in 3 Easy Steps!

If the above one can't help you get the desired result, please provide some sample data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want.

1. Create sort order dimension tables as below screenshot using Enter Data method

yingyinr_0-1650344767412.png

2. Create the relationships between dimension tables and fact table

yingyinr_1-1650344855497.png

3. Apply the fields in the dimension tables onto the matrix and sort ROWHEADING1 and ROWHEADING2 by column: Sort order

yingyinr_2-1650344928651.png

In addition, you can refer the following links to get it.

Sort one column by another column in Power BI

Sort a Column with a Custom Order in Power BI

yingyinr_3-1650345084174.png

Power BI - Custom Sorting in 3 Easy Steps!

If the above one can't help you get the desired result, please provide some sample data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

How to upload PBI in Community

Best Regards

Anonymous
Not applicable

Thanks for the reply. It works

amitchandak
Super User
Super User

@Anonymous , You need to create sort columns for both of them and marks as sort column

 

example 1

Row heading 1-1 [Row Heading 1]

 

Row heading 1 sort = Switch([Row heading 1],

"BBB",1,

"CCC",2,

3)

 

You can mark Row heading 1 sort as a sort column for Row heading 1  or Row heading 1 _1 and use is visual Additional column suggested to avoid circular dependency

 

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
Anonymous
Not applicable

Yes, It helped. Thanks a lot

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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