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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Kames_Chia
Frequent Visitor

Help Needed - Sorting in Matrix visual for formatted text in Value

I use the Matrix visual to show the total production time for every factory located in different country and region.

 

For the Matrix visual:

1. On Row field:
Region
Country
Factory name

 

2. On Value field
Total production time (column name: TOTAL_PROD_TIME_USER_READABLE)

 

TOTAL_PROD_TIME_USER_READABLE is a calculated column, which I wrote the DAX formula to convert the Total production time from seconds [column name: Total_PROD_TIME_IN_SECONDS) into this format: weeks,days,hours,minutes

 

Total_PROD_TIME_IN_SECONDS is used to define the sort order ofTotal_PROD_TIME_USER_READABLE via Column Tools --> Sort by Column

 

table data.jpg

 

Sort by column.jpg

 

As you can see in below screenshot, 
The total production time is sorted in Descending Order for the two visuals - Table and Matrix.
Europe which took 13615 weeks (longer time) should be on the top row instead of Asia which took only 387 weeks.

The Matrix visual does not show the correct sorting order for the production time. 

 

If using table visual, Total_PROD_TIME_USER_READABLE can be well sorted, this is fine. 

 

Table visual.jpg

 

But, the sorting for Total_PROD_TIME_USER_READABLE is not working by using Matrix visual if added the Total_PROD_TIME_USER_READABLE into Value field, regardless of using FIRST or LAST.

 

Matrix Visual.jpg

 

Your advice to solve this will be much appreciated. Thanks.

4 REPLIES 4
elitesmitpatel
Super User
Super User

hey @Kames_Chia 

I tried to understand your problem and found out that 
Sorting is not possible as their are 3 level of selection 

elitesmitpatel_0-1720444539773.png

index is what we have to sort but 3 level of selction is making it difficult to sort.

Hi @elitesmitpatel 

 

Thanks for checking. I've tried with 1 level of selection for quick validation, but still the column is not sorted correctly as shown in below screenshot.


Does it mean that Matrix visual (especially the VALUE field) simply does not work correctly in case of using another column to define the sorting order of another column?
  simplified version.jpg

Hi, 

 

I still hope to use Matrix visual for my report.

May I know is there any solution to fix the sorting concern in Matrix visual.

 

 

elitesmitpatel
Super User
Super User

Attach the PBIX file with dummy data for easy referencce

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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