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
NLEIGH
Helper I
Helper I

How to sort by day of the week

Hi, 

 

Please can someone let me know how to sort a column in a table by week day (ie Mon, Tue, Wed etc), I have tried to do this via the sort by column button, however I dont seem to get the same options as shown sources.

 

Please see below visual of the table.  Any help would be much appreciated.

 

NLEIGH_0-1698766741403.png

 

 

4 REPLIES 4
NLEIGH
Helper I
Helper I

Hi,

 

Is this what you meant ?  the data used is from the "2023 Raw Data" file and i'm using the "Day" data.

 

NLEIGH_0-1699363948529.png

 

JorgePinho
Solution Sage
Solution Sage

Hello @NLEIGH !

In Power BI, follow these steps:

  1. Click on the "Modeling" tab in the Power BI Desktop application.

  2. New Column: In the "Modeling" tab, click on the "New Column" option. This will allow you to create a custom column that you can use for sorting. In the formula bar that appears, enter this DAX formula that assigns a numerical value to each of the week days:WeekdayOrder = SWITCH([Weekday], "Mon", 1, "Tue", 2, "Wed", 3, "Thu", 4, "Fri", 5, "Sat", 6, "Sun", 7)

    In this formula, "Weekday" should be replaced with the name of your column containing the week days. 

  3. Now select the original column (the one with Mon, Tue...) and then on the column tools use the Sort By Column and choose the new costum column we just created.

Remember to adjust the DAX formula if your week day column contains different values or labels for week days.

Hi Jorge, Many thanks for taking the time to reply.  I have tried to follow the steps (i'm still new to Power Bi), however i'm getting this error message when I try to sort by the new column I've created.

RJLEIGH_0-1698926899357.png

I've also attached below a screenshot of the new column measure just in case that helps

 

RJLEIGH_1-1698926962437.png

Do you have any idea what i've done wrong 

 

Many thanks

 

Can you show your data model please?

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