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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
anelliaf
Helper II
Helper II

Matrix Visual - Sort by Day Of Week and Column Bucket

I'm using a Matrix visual to display events by Day of Week (rows) and time blocks (columns, e.g., 12a–5a, 6a–11a, etc.). I've created custom columns with corresponding sort columns (DayOfWeekNum, TimeBlockSort) and used "Sort by Column" to enforce order.

However, the Matrix ignores the sort order and displays both days and time buckets alphabetically instead of by the sort logic. All fields are in the same table and the model settings are correct.

How can I get the Matrix to respect the sort order on both rows and columns?

1 ACCEPTED SOLUTION
Bmejia
Super User
Super User

Hi,
It would be important to see the table structure, but the sort column should be done only on your header column within the table.  Create a column with the sort colum values like "SortColumn" below using a conditional column or table that can reference the sort values.  Then go to "Column tools" and select the column1 header and then click on "Sort by column" and select "SortColumn"

 

Bmejia_1-1745349493816.png

 

 

View solution in original post

5 REPLIES 5
Bmejia
Super User
Super User

I tried to recreate what you were getting, so I believe was able, so you do need to use the column from your "Audittimeblocktable" for the timeblocklabel rather then the one from the main table where your data resides in order it to work.  

or you can create a new column in the main table to bring the "timeblocksort=

RELATED(AuditTimeBlockTable[TimeBlockSort])", then sort the "TimeblockLabel" in the main table by the new column.

 

Bmejia_0-1745353119033.png

 

Bmejia
Super User
Super User

missed 4th step sort by sortcolumn

Bmejia_0-1745349940267.png

 

Bmejia
Super User
Super User

Hi,
It would be important to see the table structure, but the sort column should be done only on your header column within the table.  Create a column with the sort colum values like "SortColumn" below using a conditional column or table that can reference the sort values.  Then go to "Column tools" and select the column1 header and then click on "Sort by column" and select "SortColumn"

 

Bmejia_1-1745349493816.png

 

 

Here's what I have for the time blocks and I'm already sorting by the timeblocksort column.

 

AuditTimeBlockTable =
DATATABLE(
    "TimeBlockLabel", STRING,
    "TimeBlockSort", INTEGER,
    {
        {"12a–5a", 1},
        {"6a–11a", 2},
        {"12p–5p", 3},
        {"6p–11p", 4}
    }
)
 
anelliaf_0-1745350459681.png

 

make sure both tables are link on TimeBlockelabel and that you are using the Timeblocklable from  your sort table, one showing above. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors