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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Jeanxyz
Impactful Individual
Impactful Individual

how to sort columns in a matrix visual

I have a matrix, the columns are entity names from dim_entity table. I have sorted the entities column by another colmnn called "rank order" in my dim_entity table. 

For some reason, the matrix visual is showing entities by descending "rank order" , how can I change the sorting to ascending order?

 

sort columns in a table.png

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Jeanxyz ,

 

According to your description, if you want to sort the columns in the matrix based on rank, you need to put the rank into the matrix; otherwise it is sorted based on the value against row or value.

vhenrykmstf_0-1664777443780.png

Amount_filter = sum(FactInternetSales[SalesAmount])
Rank =
IF (
    HASONEVALUE ( DimProduct[Color] ),
    RANKX ( ALLSELECTED ( DimProduct[Color] ), [Amount_filter] ),
    BLANK ()
)

vhenrykmstf_1-1664777477032.png

vhenrykmstf_2-1664777496693.png


If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Jeanxyz ,

 

According to your description, if you want to sort the columns in the matrix based on rank, you need to put the rank into the matrix; otherwise it is sorted based on the value against row or value.

vhenrykmstf_0-1664777443780.png

Amount_filter = sum(FactInternetSales[SalesAmount])
Rank =
IF (
    HASONEVALUE ( DimProduct[Color] ),
    RANKX ( ALLSELECTED ( DimProduct[Color] ), [Amount_filter] ),
    BLANK ()
)

vhenrykmstf_1-1664777477032.png

vhenrykmstf_2-1664777496693.png


If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors