How to Sort Week in Power BI
If you've ever tried to create a chart showing data by the day of the week in Power BI, you've likely run into a frustrating sorting issue. Instead of seeing a neat Monday-to-Sunday progression, your days are sorted alphabetically: Friday, Monday, Saturday, Sunday. This article will show you exactly how to fix that common problem by teaching Power BI the correct chronological order for your weeks.
Why Power BI Sorts Your Week Alphabetically
The root of the problem is simple: Power BI sees "Monday," "Tuesday," and "Wednesday" as just text strings. By default, it sorts text alphabetically. It doesn't inherently understand that "Tuesday" is supposed to come after "Monday." To Power BI, 'M' comes after 'F' (Friday), and 'S' (Saturday) comes before 'T' (Tuesday).
Look at this simple bar chart showing sales by day. See the problem?
Example: Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday
This isn't helpful for analyzing weekly trends. To fix this, we need to give Power BI a little help. We'll create a second, hidden column that contains a number for each day of the week (e.g., 1 for Monday, 2 for Tuesday) and then tell Power BI to use that numerical column to sort our day names.
The Solution: The "Sort by Column" Feature
The key to solving this weekly sorting headache is a powerful feature called Sort by Column. It allows you to select one column (like our text-based day names) and define its sorting order based on the values in another column (a numerical one we're about to create).
The process is straightforward:
- Create a column with the text name for the day of the week (e.g., "Monday").
- Create a second, numeric "helper" column with the week's order (e.g., "1").
- Use the "Sort by Column" feature to sort our text column by our number column.
Let’s walk through the process step-by-step using DAX, the most common method for this task.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Step 1: Create Your Day Name and Number Columns with DAX
First, we need to add two new calculated columns to our date table in the Power BI data model. If you don't have a dedicated date table (often called a 'Date Dimension'), these columns can be added to your main data table that contains a date field. For this example, let's assume you have a table named Sales with a date column called [OrderDate].
Navigate to the Data view by clicking the grid icon on the left-hand sidebar in Power BI Desktop.
Add the "Day Name" Column
This column will hold the full text name for the day of the week.
- Select the table you want to modify from the Fields pane on the right.
- From the top ribbon, click on the Column tools tab, then click New column.
- A formula bar will appear. Enter the following DAX formula:
Day Name = FORMAT([OrderDate], "dddd")Press Enter. Power BI will create a new column containing the full name of the day for each date in your [OrderDate] column. The "dddd" format code specifically tells the FORMAT function to return the full day name (e.g., "Monday"). Using "ddd" would return the abbreviated name ("Mon").
Add the "Day of Week Number" Helper Column
Now, we create the critical helper column that defines the sorting order. This will contain a numerical value for each day.
- With your table still selected, once again click New column in the ribbon.
- In the formula bar, enter this DAX formula:
Day of Week Number = WEEKDAY([OrderDate], 2)Let's break down this formula quickly:
- The
WEEKDAYfunction returns a number from 1 to 7 representing the day of the week for a given date. [OrderDate]is the date column we're evaluating.- The second argument,
2, is thereturn_type. This is important! Areturn_typeof 2 tells Power BI to use a system where Monday is 1 and Sunday is 7. This is the most common setup for business reporting. If you left it blank or used1, Sunday would be 1 and Saturday would be 7, which might mess up your sort order.
After pressing Enter, you'll have two new columns in your table: Day Name and Day of Week Number. Your data should look something like this:
Step 2: Apply the "Sort by Column" Logic
Now that we have both our text column and our numerical sorting column, we can connect them.
- Stay in the Data view.
- In the Fields pane (or by clicking the column in the data grid), select the Day Name column. It’s very important that you select the column you want to sort, not the column you're using to define the sort order.
- When you select it, the Column tools tab will appear in the top ribbon.
- Find and click the Sort by column button.
- A dropdown list will appear showing all the other columns in your table. Select our helper column: Day of Week Number.
And that's it! You won't see anything immediately change in the Data view grid, but you've just told Power BI that whenever it uses the Day Name column in a visual, it should use the order defined by Day of Week Number instead of alphabetical order.
Step 3: Verify the Result in Your Report
Now for the satisfying part. Switch back to the Report view by clicking the chart icon on the far left sidebar.
If you already have a visual using your old unsorted day names, you should see it instantly update to the correct chronological order: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.
If you don’t have a visual yet, create one. For example, drag the Day Name column onto the X-axis of a bar chart and a sales metric (like Sales Amount) onto the Y-axis. The days will appear in the proper order right away.
You can also confirm this works in slicers, tables, and matrices. Any visual using the Day Name column will now respect the new sort order.
Advanced Tip: Sorting Other Time Periods
This "helper column" technique is not just for days of the week. It’s the universal Power BI solution for sorting any custom text-based period logically.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Sorting by Month
Similar to days, Power BI will sort months alphabetically ("April," "August," "December"). To fix it, you create columns like:
- Month Name:
Month Name = FORMAT([OrderDate], "MMMM")- Month Number:
Month Number = MONTH([OrderDate])Then, select the Month Name column and use "Sort by Column" to sort it by the Month Number column.
Sorting by "Week Number"
A "Week 1", "Week 2", "Week 10" label will also default to alphabetical sorting, placing "Week 10" before "Week 2".
- Week Label:
Week Label = "Week " & WEEKNUM([OrderDate], 2)- Week Number Helper:
Week Number Helper = WEEKNUM([OrderDate], 2)Then, sort Week Label by Week Number Helper.
Final Thoughts
Teaching Power BI how to properly order time-based categories is a fundamental skill that moves you from a beginner to an intermediate user. The core concept is simple: if you want to sort a text column in a non-alphabetical way, you need a numeric helper column and the "Sort by column" feature to make the connection.
At times, wrangling data with DAX formulas and configuring model settings can interrupt your flow of analysis. For marketers and business owners who need to get answers without digging into the technical details, this is where new tools are making a difference. Our platform, Graphed, helps automate much of this setup. For example, when you connect a source like Google Analytics and ask for a report showing traffic by day of the week, we automatically handle the data modeling and sorting so the chart just shows up correctly, letting you focus on the insights, not the formulas.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.