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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.