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

How to sort matrix columns descending?

I have a matrix with a text field as the Row field, and an integer as the Column field. The columns display in ascending order. I want the columns to show in descending order. There does not seem to be an option to sort the matric by the column field.

How do I achieve this?

EylesIT_0-1607126565249.png

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You'll have to make your sort column in the query editor to avoid the circular dependency error. [Age]* -1 like you did before but in query.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

7 REPLIES 7
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

Try to create a Rank column as below:

Rank = RANKX('Table','Table'[Age],,DESC,Dense)

To avoid  "A circular dependency......",please create another column 'Age2'

Age 2 = 'Table'[Age]

 Then sort column ‘Age2’ by column "Rank":

65.png

The result will show as below:

66.png

 

Please check attached pbix file for more details.

 

Best Regards,
Community Support Team _ Eason

mahoneypat
Microsoft Employee
Microsoft Employee

You'll have to make your sort column in the query editor to avoid the circular dependency error. [Age]* -1 like you did before but in query.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

how to make columns in metrix visualsort desecending in live connection

MattAllington
Community Champion
Community Champion

I assume you mean the columns of data. This is not possible because it is a table of data, not a set of 18 independent columns. Each has their own sort order



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

@MattAllington, SSRS does this just fine. In the Column Group settings you can select which data field should be used to sort the Column Headers in the matric visual.

I want to know how to achieve the same in Power BI.

mahoneypat
Microsoft Employee
Microsoft Employee

You'll need to make a Sort By Column for the column used in the Matrix columns.  Please see this article.

Quick Tips: How to Sort Matrix by Column in Descending Order (biinsight.com)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

@mahoneypat In the Data tab, I have done this:

created a new calculated column called NegAge as = -[Age]

tried to set the Sort By Columns on the Age Column to be NegAge. But this results in an error "A circular dependency was detected"

 

Instead, I tried setting the [Age] Column sort option to "Sort descending". But none of that changes the [Age] columns in the matrix from displaying in ascending order.

 

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.