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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
littlefox
New Member

Matrix Visualization Sorting by Column

Hi Everyone,

I have a matrix visualization which shows periods across the top and $ values (see below).  I need to sort the list of Top N brands by the last column.  As you can see, Brand #3 should be on the top row if sorted correctly.

PBI Post.png

In my source data, I have columns for brand, period, $, and a period sort (a conditional if column used to sort the headers below in the correct order). I also have a conditional column which pulls over Latest 52 Wk $ data which I created hoping that I could sort there and get the brands in the correct order.

 

Thanks in advance for suggestions,

LF

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @littlefox

Here is a workaround

Create a calculated column

rank = IF([period]="last51-5",RANKX(FILTER(ALL(Sheet1),[period]="last51-5"),[$ values],,DESC,Dense))

7.png

Add "rank" column to "Value" Field of the matrix.

5.png

Sort by "Rank"column

6.png

 

Best Regards

Maggie

View solution in original post

3 REPLIES 3
rjhartop
Helper II
Helper II

Another way to approach this is discussed in this blog post:

 

https://affinityworks.co.uk/power-bi-matrix-column-sort-sorted/

v-juanli-msft
Community Support
Community Support

Hi @littlefox

Here is a workaround

Create a calculated column

rank = IF([period]="last51-5",RANKX(FILTER(ALL(Sheet1),[period]="last51-5"),[$ values],,DESC,Dense))

7.png

Add "rank" column to "Value" Field of the matrix.

5.png

Sort by "Rank"column

6.png

 

Best Regards

Maggie

zlokesh
Resolver I
Resolver I

Please follow the setps in below image.

 

top N.JPG

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.