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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Column SORTING in Matrix Visual

Hi Everyone,

 

I am facing an issue with the sorting of columns in Power BI Matrix visual.

 

Problem Statement : Below is the test data set that we are using.

We want to sort country column i.e. (USA,India, Australia,England)  based on the Row C figures falling in the column Total and is also highlighted in Red.

 

Total( Measure) = Direct + Indirect PBI_Sort.png

Please provide your suggestions to attain this functionality or any workarounds to achieve same.

 

Thanks,

Ashish

 

 

 

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Unfortunately, power Bi cannot sort in matrix.

As far as i konw,we can't set conditional formatting in row field, we can only set conditional formatting in value field.

You can create DAX like this and apply in conditional formatting.

Measure = IF(MAX(table[product])=C,"#ff0000")
conditional formatting.PNG

 

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

Anonymous
Not applicable

Hey @Anonymous 

 

Power BI does not have functionality for sorting by rows in a power bi matrix. Your options are

 

1. To try the sort by function in the visual or Modeling tab: https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

2. Sort By in the query editor: https://community.powerbi.com/t5/Desktop/Sorting-columns-in-Query-Editor/td-p/339238

3. Pivot your visual to switch the columns and rows so you can simply click the column C header to sort by that column.

4. Use the RANK (or RANKX) DAX functions to ranks your countries and sort that way: https://community.powerbi.com/t5/Desktop/Dynamic-ranking-by-sorted-column/td-p/501152

https://powerbi.tips/2017/07/ranking-values-with-measures/

 

If this helps please kudo.

If this solves your problem please accept it as a solution.

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.