How to Sort Month Name in Power BI Slicer
It’s a frustratingly common Power BI problem: you add a slicer to let users filter by month, but instead of "January, February, March," it shows up as "April, August, December." Your months are sorted alphabetically, not chronologically. This article will show you exactly why this happens and walk you through two simple, effective methods to fix it for good.
Why Power BI Sorts Your Months Alphabetically
The solution starts with understanding why Power BI gets this wrong in the first place. When you have a column with data like "January," "February," and "March," Power BI sees these as simple text strings. It has no inherent understanding that "February" comes after "January." So, it applies its default sorting rule for text: A to Z.
This is why you get an alphabetically ordered list that makes no sense for dates. Your report shows "April" first because "Ap" comes before "Au" (August). It's not a bug, it's just Power BI doing exactly what you asked it to — sort text alphabetically. To fix this, you need to give Power BI an explicit instruction on the correct chronological order, and the best way to do that is by using month numbers.
Method 1: The Quick Fix with a Month Number Column
This is the fastest and most direct way to solve the sorting issue. It involves creating a new column in your data table that contains the corresponding number for each month (1 for January, 2 for February, etc.). You then tell Power BI to use this new number column as the sorting guide for your month name column.
Step 1: Navigate to the Data View
In Power BI Desktop, look at the left-hand navigation bar. You'll see three icons: Report, Data, and Model. Click on the Data view icon (the one that looks like a small spreadsheet). This takes you away from your dashboard canvases and shows you the raw data in your tables.
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 2: Add a New Calculated Column
Make sure you have your main data table selected in the Fields pane on the right. In the ribbon at the top of the screen, under the "Table Tools" or "Column Tools" tab, click on New Column. This will open up the formula bar, where you'll enter a DAX (Data Analysis Expressions) formula.
Step 3: Write the DAX Formula for Month Number
In the formula bar, you'll use the simple MONTH() function. This function extracts the month number from a date column. Type the following formula, replacing 'YourTable'[Date] with the actual names of your table and date column.
MonthNumber = MONTH('Sales'[OrderDate])
Here's a breakdown:
- MonthNumber = This is the name we're giving our new column. You can call it whatever you want, like "Month Sort Order" or "Month Num."
- MONTH() is the DAX function that returns a number from 1 to 12.
- 'Sales'[OrderDate] is the reference to the existing date column in our table named "Sales." You must have a column with a proper date data type for this to work.
Press Enter. You should now see a new "MonthNumber" column in your table with the correct numeric value for each month.
Step 4: Use the "Sort by Column" Feature
This is the most critical step. Now you need to link your month name column to your new month number column.
- First, in the Data view, click to select the column containing your month names (e.g., "MonthName" or "Month"). Do not select the new
MonthNumbercolumn you just created. - With the month name column highlighted, go to the Column Tools tab in the ribbon.
- Click on the Sort by Column button. A dropdown menu will appear.
- From this list, select your newly created MonthNumber column.
That's it! You won’t see anything change immediately in the Data view table itself, but you have just told Power BI that any time it displays the "MonthName" column in a visual, it should use the "MonthNumber" column to determine the sort order.
Step 5: Verify Your Slicer is Sorted Correctly
Go back to the Report View by clicking the icon in the left-hand navigation. Your slicer (and any other visuals using that month name field) should now automatically display the months in the correct chronological order: January, February, March, and so on. If it doesn't update, click the three dots (...) on your slicer and make sure it is set to Sort Ascending and sorting by your month name column.
Method 2: The Best Practice Approach with a Calendar Table
While the first method is fast, Power BI experts will tell you that the more robust and scalable solution is to use a dedicated Calendar Table (also called a Date Table). A Calendar Table is a separate table in your model that contains all your dates and associated time periods (like year, quarter, month name, day of the week, etc.).
This approach centralizes all your date-based logic, making your model cleaner, your DAX formulas simpler, and your reports more consistent. Here's how to create one and use it to solve the month sorting problem.
Step 1: Create a Calendar Table
In Power BI, you can create a new table using DAX. Go to the Data view, and in the "Home" or "Table Tools" ribbon, click New Table.
In the formula bar, enter the following DAX function:
DateTable = CALENDARAUTO()
The CALENDARAUTO() function scans all the date columns in your entire model, finds the earliest and latest dates, and then generates a table with a single continuous column of every date between them. This ensures your Calendar Table covers the complete date range of your data.
Press Enter. You'll now see a new table named "DateTable" appear in your Fields pane with a single column called "Date."
Step 2: Add Helper Columns to Your Calendar Table
Now, we'll enrich this new table with columns for month name, month number, and year. With your new DateTable selected, add these as new calculated columns, one by one:
Month Name:
MonthName = FORMAT('DateTable'[Date], "mmmm")
The FORMAT function converts a date into a text string in the format you specify. "mmmm" gives the full month name (e.g., "January"). If you wanted the abbreviation, you could use "mmm" (e.g., "Jan").
Month Number:
MonthNumber = MONTH('DateTable'[Date])
This is the same formula we used in the first method, but now it's part of our dedicated Calendar Table.
Year:
Year = YEAR('DateTable'[Date])
This adds a column for the year, which is essential for filtering by both month and year later on.
Step 3: Establish a Relationship
A table on its own doesn’t do anything, you need to tell Power BI how it relates to your data. Go to the Model view (the last icon on the left-hand navigation). You'll see boxes representing the tables in your model.
Find your new DateTable and your main data table (e.g., Sales). Click and drag the [Date] column from your DateTable and drop it directly onto the relevant date column in your Sales table (e.g., [OrderDate]). Power BI will create a line between them, indicating a one-to-many relationship. This connects every date in your master calendar to all transactions that occurred on that day.
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 4: Apply the "Sort by Column" Setting
Just like in the first method, head back to the Data view, select your new DateTable, click on the MonthName column, and use the Sort by Column feature in the ribbon to sort it by the MonthNumber column.
Step 5: Use the Calendar Table Fields in Your Visuals
This is the most important rule when using a Calendar Table: from this point forward, you must always use the date-related columns from your DateTable for all your charts, slicers, and tables.
Go to your report, click on your month slicer, and in the Visualizations pane, remove the old month field from your Sales table. Then, find your DateTable in the Fields list, and drag the MonthName field into the slicer. The slicer will now use the correctly sorted month names from your new, centralized, and highly-optimized date table.
Troubleshooting Common Issues
Still not working? Here are a few common pitfalls to check:
- You sorted the wrong column: Double-check that you first selected the text column you want to sort (e.g.,
MonthName) before clicking "Sort by Column" and choosing the number column (e.g.,MonthNumber). A common mistake is selecting the number column and trying to sort it by itself. - Relationship problems: If you're using a Calendar Table, go to the Model View and ensure the relationship to your data table is active (the line is solid, not dotted) and the direction is correct (one-to-many, from the Date Table to your data table).
- Using the old date field: The most frequent issue with the Calendar Table method is forgetting to replace the old date fields in your visuals with the new ones from the DateTable. Make sure your slicer is using
DateTable[MonthName], notSales[Month]. - Incorrect data types: Make sure Power BI recognizes your main date column as a proper "Date" type and your MonthNumber column as a "Whole Number." You can check and change this in the Data view using the "Data type" dropdown in the Column tools ribbon.
Final Thoughts
Learning how to properly sort months unlocks a fundamental skill in Power BI: telling Power BI how to handle custom sorting that isn't alphabetical or numerical. By creating a helper column with the proper order and using the powerful "Sort By Column" feature, you take control of your visualizations and ensure they are clear and intuitive for your audience.
Manually creating calendar tables and fixing sort columns in Power BI is often just the first step in a much longer process of building and maintaining reports. We created Graphed to remove this kind of manual setup entirely. Instead of configuring data models and DAX, you can simply ask, "show me website sessions by month this year as a line chart." We build the dashboards for you, correctly sorted and updating in real-time, allowing you to get answers in seconds instead of spending hours on setup.
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.