How to Change Order of Bars in Power BI

Cody Schneider••7 min read

Power BI is fantastic at turning data into visuals, but its default way of sorting bars in a chart can be confusing. Your bar chart of monthly sales might appear in alphabetical order (April, August, December...) instead of chronological order, instantly making your report less useful. This guide will walk you through the simple and advanced methods to take control and arrange the bars in your Power BI charts exactly how you need them.

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

Understanding Power BI's Default Sorting

Before jumping into the fixes, it helps to know why Power BI sorts your data the way it does. By default, Power BI sorts text fields (like product categories, names, or months) alphabetically. For numerical fields, it sorts from largest to smallest. While this logic is consistent, it often doesn't align with the story you're trying to tell.

For example, if you're visualizing survey results with categories like "Very Dissatisfied," "Dissatisfied," "Neutral," "Satisfied," and "Very Satisfied," an alphabetical sort would be practically unreadable. You need to control the order to present a clear, logical progression. Fortunately, there are several ways to do this.

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.

Method 1: The Quick Sort (Using the 'Sort By' Menu)

The easiest method for reordering bars is to sort one column based on the value of another. This is perfect for common scenarios, like sorting product categories by their total sales or campaign names by their cost-per-click.

When to Use This Method:

  • When you want to sort a text category (like 'Product') by a numerical value (like 'Revenue').
  • When you need to quickly see the top or bottom performers in a category.
  • When a simple ascending or descending order is all that's required.

Step-by-Step Instructions:

  1. Select the bar chart visual on your Power BI report canvas. A border will appear around it.
  2. In the top-right corner of the visual, click the ellipsis (...) button to open the options menu.
  3. Hover over "Sort by". You will see a list of the fields being used in your visual.
  4. Select the field you want to use for sorting. For example, if your X-axis shows 'Country' and your Y-axis shows 'Sales Amount', you would select 'Sales Amount' to order the countries based on their sales.
  5. After selecting the sort field, click the ellipsis (...) again and navigate to "Sort descending" or "Sort ascending" to get the order just right. 'Sort descending' will show the highest value first (leftmost bar), while 'Sort ascending' will show the lowest value first.

This simple fix resolves a majority of basic sorting issues and can be done in just a few seconds.

Method 2: Custom Sorting with a 'Sort by Column' (The Powerful Fix)

What if you need to sort your bars in an order that isn't alphabetical or based on a numerical value? This is common for things like months of the year, days of the week, or priority levels (e.g., High, Medium, Low). In these cases, the quick sort won't work. The solution is to create a "helper" column that defines the custom order.

When to Use This Method:

  • For chronological sorting (e.g., January, February, March...).
  • For categorical sorting that has a logical order (e.g., Trainee, Junior, Mid-Level, Senior).
  • To sort report periods like Week 1, Week 2, Week 3... correctly (alphabetically, 'Week 10' would come before 'Week 2').

Step 1: Create a Custom Sort Column with DAX

First, you need to tell Power BI the numerical order for your categories. We'll do this by adding a new column to your data table using a DAX formula.

  1. Navigate to the Data view by clicking the table icon on the left-hand navigation pane.
  2. Select the table that contains the column you want to sort (e.g., a 'Calendar' table for months or a 'Sales' table with statuses).
  3. In the 'Table tools' ribbon at the top, click "New column."
  4. Power BI's formula bar will appear. Here, you'll write a simple DAX formula to assign a number to each category. The SWITCH() function is perfect for this.
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

Example 1: Sorting Months Chronologically

Let's say you have a column named 'MonthName'. To create a sorting column, enter this formula:

Month Sort Order = 
SWITCH(
    'YourTableName'[MonthName],
    "January", 1,
    "February", 2,
    "March", 3,
    "April", 4,
    "May", 5,
    "June", 6,
    "July", 7,
    "August", 8,
    "September", 9,
    "October", 10,
    "November", 11,
    "December", 12
)

This formula creates a new column called 'Month Sort Order' and assigns a 1 to January, a 2 to February, and so on. Remember to replace 'YourTableName' with the actual name of your table.

Example 2: Sorting Service Tiers

Imagine you have a 'Service Tier' column with a custom order: Basic, Plus, Premium, and Enterprise.

Tier Sort Order = 
SWITCH(
    'YourTableName'[Service Tier],
    "Basic", 1,
    "Plus", 2,
    "Premium", 3,
    "Enterprise", 4
)

Step 2: Tell Power BI to Use Your New Sort Column

Now that you have your helper column, you need to map it to the original column you want to sort.

  1. While still in the Data view, single-click to select the original text column you want to sort (e.g., 'MonthName', not the new 'Month Sort Order' column). This is a crucial step! The header for that column should now be highlighted.
  2. Go to the 'Column tools' tab in the ribbon at the top of the screen.
  3. Click on the "Sort by column" button.
  4. A dropdown list will appear. Select your newly created numerical sort column (e.g., 'Month Sort Order').

Power BI now understands the hidden logic. Internally, whenever it sees 'MonthName', it will use the numbers in 'Month Sort Order' to determine the correct arrangement.

Step 3: Check Your Visual

Return to the Report view (the top icon in the left-hand navigation). Select your bar chart again, click the ellipsis (...), go to "Sort by," and select your text column (e.g., 'MonthName'). Voila! The bars should now be sorted in the custom order you defined. You do not need to add the helper sort column to the chart itself, it just works in the background.

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.

Bonus Tip: Using a Look-up Table for Complex Sort Orders

If you have dozens of categories, writing a massive SWITCH() formula is tedious and hard to maintain. A better approach for complex cases is to create a dedicated look-up table. This is the most scalable best practice.

Instructions:

  1. Create a Sorting Table: In Excel or a Google Sheet, create a simple two-column table. One column contains the category name (e.g., 'Status'), and the second contains its desired sort order (e.g., 'SortOrder').
  2. Load the Table into Power BI: Use 'Get Data' to import this new table into your Power BI model.
  3. Create a Relationship: Go to the Model view (the bottom icon in the left-hand navigation). Create a relationship by dragging the category name column from your new sorting table to the corresponding column in your main data table. This should be a one-to-many relationship.
  4. Apply the Sort: You can now use the 'SortOrder' column from your new look-up table to sort your category column, just like in Method 2. Select the category column in your main data table, click 'Sort by column,' and choose the 'SortOrder' field from the related look-up table. This keeps sorting logic separate and easy to update without touching DAX.

Final Thoughts

Mastering bar chart sorting is a fundamental skill that transforms busy Power BI reports into clear, scannable dashboards. Whether you're using the simple 'Sort by' menu for quick analysis or the 'Sort by Column' feature for precise, custom orderings, you now have the tools to make your data tell the right story every time.

Of course, sometimes the goal isn't to spend time perfecting the details, but to get answers fast. That’s where new tools are making complex data analysis much more approachable. At Graphed , we've connected our AI data analyst to tools like Google Analytics, Shopify, and Salesforce so you can skip the setup entirely. Instead of configuring sorts and filters, you just connect your data and ask questions in plain English — like "create a bar chart showing revenue by country last quarter" — and watch a live, interactive dashboard get built for you in seconds.

Related Articles