How to Sort Power BI Data by Month or Week Chronologically
Question details
The user needs to know how to sort data chronologically by month or week instead of alphabetically in Power BI.

- Product
- Power BI
- Device & OS
- not provided
- Scenario
- Creating visual reports or dashboards where time-based data needs to be displayed in a logical, chronological order rather than an alphabetical one.
- Observed behavior
- Power BI defaults to sorting month names alphabetically (e.g., April, August) and week values incorrectly (e.g., Week 10 before Week 2) when they are stored as text.
Ensure you have a numeric reference column (such as month numbers 1-12) available in your dataset, and verify that your week data contains numerical values rather than just text.
Sort Month Names Chronologically Using a Numeric Column
Use the Sort by Column feature to force Power BI to order month names based on their corresponding month numbers instead of alphabetically.
By default, Power BI treats text columns alphabetically. To establish chronological order, you must explicitly link your text-based month column to a numeric month column.
Navigate to the Data or Modeling view and click on the column containing your month names.
Go to the 'Modeling' tab on the top ribbon menu.
Click on 'Sort by Column' and select your 'Month Number' column from the dropdown list.

Correct Week Sorting by Changing Data Type
Prevent week numbers from sorting incorrectly (e.g., week 10 appearing before week 2) by converting the text column to a numeric format.
Need a Free Alternative for Everyday Data Analysis? Try WPS Office
While Power BI handles complex datasets, WPS Spreadsheet provides a lightweight, free, and highly compatible alternative for everyday data sorting, pivot tables, and visual charts. Transition easily with familiar interfaces and robust features.
- 1. Open your dataset: Launch WPS Spreadsheet and open your .xlsx or .csv data file.
- 2. Select your data: Highlight the column containing your date, month, or week information.
- 3. Apply custom sorting: Go to the 'Data' tab, click 'Sort', and choose 'Custom Sort' to order your data chronologically.

Frequently Asked Questions
Why does Power BI sort my months alphabetically instead of chronologically?
By default, Power BI treats text columns like month names as alphabetical strings. You must explicitly tell Power BI to sort the text column by a corresponding numerical column (like month numbers 1-12) using the 'Sort by Column' feature.
How do I fix week 10 appearing before week 2 in Power BI?
This happens when the week data is formatted as text. To fix it, select your week column, navigate to the Column tools, and change the Data Type from Text to Whole Number or Decimal Number.
What if I don't have a month number column in my dataset?
You will need to create one. You can use DAX functions like MONTH() or Power Query to extract the numerical month from your date column before applying the Sort by Column feature.
Can I sort data using a custom list order in Power BI?
Yes. You can create a conditional column in Power Query that assigns a specific numerical value to your custom categories, and then use that new numeric column in the Modeling > Sort by Column menu to order your data.




