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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Jeanxyz
Post Prodigy
Post Prodigy

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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