How to Sort Months in Power BI Graph

Cody Schneider••8 min read

It’s one of the first frustrations nearly everyone faces in Power BI: you build a simple chart to show data over time, but the months are sorted alphabetically. Your bar chart proudly displays April, August, and December first, while the rest are scattered in a way that makes zero chronological sense. This happens because Power BI, by default, sees "January" not as a point in time, but just another text string like "Apples" or "Bananas".

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

In this tutorial, we will walk you through exactly how to fix this common issue. You'll learn how to tell Power BI the correct order for your months so your charts are always clear, accurate, and easy to read.

Why Power BI Sorts Months Alphabetically By Default

Before fixing the problem, it helps to understand why it happens. When you import data, Power BI analyzes each column and assigns it a data type, such as a number, a date, or text. If you have a column with month names like "January", "February", and "March", Power BI correctly identifies this as a text data type.

By default, Power BI sorts text alphabetically and numbers numerically. So, when your chart needs to arrange the months on its axis, it looks at the text values and applies an A-to-Z sort order:

  • April
  • August
  • December
  • February
  • ...and so on.

This isn't a bug, it's the software doing exactly what it's supposed to do with text. Our goal is to override this default behavior by providing a custom sort order for the months. The way we do this is by creating a behind-the-scenes numerical column (1 for January, 2 for February, etc.) and linking it to our month name column.

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.

Creating a Supporting "Sort" Column

The solution involves creating two specific columns from your existing date column: one with the month name and another with the corresponding month number. This gives Power BI the context it needs to sort properly. For example:

  • Month Name: January, Month Number: 1
  • Month Name: February, Month Number: 2
  • Month Name: March, Month Number: 3

You can create these columns either in the Power Query Editor (best for preparing your data model before you start building) or with DAX (Data Analysis Expressions) directly in the data model. We'll cover both methods.

Method 1: Add a Sort Column in the Power Query Editor

Using Power Query is often the best practice because it cleans and prepares your data at the source. Any changes you make here are applied every time the data refreshes, making your model robust and reliable.

Step-by-Step Instructions:

  1. From the Home tab in your Power BI Desktop report, click Transform data. This will open the Power Query Editor.
  2. In the queries pane on the left, select the table that contains your date column.
  3. Find and select your date column. For this example, let's assume it’s named ‘OrderDate’.
  4. Go to the Add Column tab in the ribbon at the top. This tab is used for creating new columns based on existing ones, without modifying the originals.
  5. With the ‘OrderDate’ column still selected, click the Date button in the ribbon. A dropdown menu will appear. Hover over Month and then click Name of Month. This will create a new column containing the full name of the month (e.g., "January"). Power BI will automatically name it "Month Name".
  6. Now, repeat the process for the month number. Select the ‘OrderDate’ column again. Click the Date button, hover over Month and this time, select Month. This will generate a column with the numerical value of the month (1-12). Power BI will name this "Month". You can rename it to "Month Number" for clarity by double-clicking the header.
  7. You should now have your original date column, a "Month Name" column (text), and a "Month Number" column (number). Now, click Close & Apply in the upper-left corner to save your changes and return to the main report view.
GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Method 2: Create a Sort Column with DAX Formulas

If you prefer to work within the main Power BI interface or your data is already loaded and you don't want to go back to Power Query, you can achieve the same result using DAX formulas.

Step-by-Step Instructions:

  1. In Power BI Desktop, navigate to the Data view by clicking the table icon on the left-hand navigation bar.
  2. Select the table containing your date data from the Fields pane on the right.
  3. Go to the Table Tools tab in the ribbon at the top and click New column.
  4. This will open the formula bar. To create your month name column, enter the following DAX formula. Replace YourTable[YourDateColumn] with the actual names of your table and date column:
Month Name = FORMAT(YourTable[YourDateColumn], "MMMM")

The "MMMM" format code tells DAX to extract the full month name from the date.

  1. Hit Enter to create the column. Now, let’s create the month number column. Click New column again.
  2. In the formula bar, enter this DAX formula:
Month Number = MONTH(YourTable[YourDateColumn])
  1. Hit Enter. You'll now see both the "Month Name" and "Month Number" columns in your data table, just as if you had created them in Power Query.

Applying the "Sort By Column" Setting (The Crucial Step)

Just creating the columns isn't enough. Now you need to perform the most important step: telling Power BI to use your "Month Number" column to sort your "Month Name" column.

  1. Stay in the Data view.
  2. In the Fields pane on the right, ensure your table is expanded. Now, click on the Month Name column to select it. It's very important that you select the text column you want to sort, not the number column.
  3. When you select the column, the Column tools ribbon will appear at the top.
  4. Click the Sort by column button. A dropdown list will appear, showing all the other columns in your table.
  5. From this dropdown, select Month Number (or whatever you named your numerical month column).

That's it! Power BI may take a second to process, but behind the scenes, it has now mapped the sort order for "Month Name" to "Month Number". Head back to your report view, and you should see the months in your chart have magically rearranged themselves into chronological order: January, February, March, and so on.

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.

How About Sorting Month Abbreviations?

Sometimes you need shorter month names (like "Jan", "Feb", "Mar") to save space on your axis. The process is almost identical. If using DAX, you just need to change the format string.

  1. Create another new column using the following DAX formula:
Month Abb = FORMAT(YourTable[YourDateColumn], "MMM")

Using "MMM" gives you the three-letter abbreviation instead of the full name.

  1. Once the column is created, select your new "Month Abb" column.
  2. Go to Column tools, click Sort by column, and select your "Month Number" column again. Your visuals using month abbreviations will now sort correctly as well.

Troubleshooting Common Problems

If your chart still isn't sorting correctly, check these common pitfalls:

  • You sorted the wrong column. The most frequent mistake is selecting the Month Number column and trying to sort it by itself. Remember, you must select the text-based Month Name column and tell it to use the number column as its sorting guide.
  • My chart is sorting in reverse (December to January). In your chart visual itself, click the three dots (...) in the top-right corner. Go to Sort axis and make sure you've selected Sort ascending.
  • There are blanks or errors. Ensure both your "Month Name" and "Month Number" columns have a value for every row containing a date. Blanks or errors can interfere with sorting.
  • You're using a Date Hierarchy. If you drag a date field into a visual, Power BI sometimes creates an automatic date hierarchy (Year, Quarter, Month, Day). If your sorting isn't working, try removing the hierarchy and using the standalone "Month Name" column you created instead.

Final Thoughts

Learning to sort months correctly is a fundamental step in mastering Power BI. It hinges on the concept of creating a helper column with the numerical month and then using the "Sort By Column" feature to define a custom sort order for your text-based month names. Once you understand this logic, you can apply it to sort anything with a non-alphabetical custom order.

We built Graphed to eliminate these kinds of manual reporting hurdles. The learning curve for traditional BI tools is filled with tiny, frustrating steps that take time away from real analysis. Instead of hunting through menus to fix a sort order, you can simply ask, "show me total revenue by month for this year sorted chronologically" and get a perfect chart instantly. With Graphed, you connect your data sources in seconds, describe the dashboards you need using plain English, and get back to analyzing your insights instead of wrestling with tool-specific quirks.

Related Articles