How to Arrange Bars in Power BI

Cody Schneider

You’ve done the hard work of connecting your data and creating a perfectly good bar chart in Power BI, but something feels off. The bars are sorted alphabetically, or by some other logic you can't quite figure out, when what you really want is to see them ranked from highest to lowest sales, or in a specific monthly order. This is a common and often frustrating hurdle, but getting your bars arranged exactly how you want is easier than you think. This guide will walk you through sorting your bars by value and how to create a completely custom sort order for things like months or business categories.

Getting Started: The Basics of Sorting

By default, Power BI often sorts the categorical axis (the X-axis on a vertical bar chart) alphabetically. This is helpful if you want to quickly find "New York" in a list of cities, but not so great when you want to see which city has the highest revenue. Luckily, the most basic sorting controls are just a few clicks away.

Let's use a simple example: a bar chart showing Total Sales by Product Category. Your categories are "Electronics," "Apparel," "Home Goods," and "Books." By default, Power BI will likely show them in that order: Apparel, Books, Electronics, Home Goods.

Sorting by Value (Highest to Lowest)

This is the most common requirement. You want to see which category is performing best. Arranging the bars in descending order makes your highest performers immediately obvious.

  1. Select the bar chart visual on your Power BI canvas to make it active.

  2. Hover over the top right corner of the visual until you see more options appear.

  3. Click the ellipsis (the three dots "...") to open the options menu.

  4. Hover over Sort axis.

  5. You will see options to sort by Product Category (your axis) or Total Sales (your value). Select Total Sales.

  6. A checkmark will appear next to it. By default, it will sort descending (from highest to lowest). If you want it sorted ascending (lowest to highest), simply go back into the menu (ellipsis > Sort axis) and select Sort ascending.

That's it! Your bar chart will now be perfectly arranged, showing the product category with the most sales at the top or on the left, instantly making your report more insightful.

Sorting by Category Name (A-Z or Z-A)

What if you want to revert to alphabetical order or flip it? The process is nearly identical.

  1. Select your chart visual.

  2. Click the ellipsis ("...") in the top corner.

  3. Hover over Sort axis.

  4. Select your category field name - in this case, Product Category.

  5. Use the Sort ascending (for A-Z) or Sort descending (for Z-A) options to finalize the arrangement.

Creating a Custom Sort Order (Manual Arrangement)

Basic sorting works well for values and alphabetical order, but what if you need a non-alphabetical, non-numerical order? This is where many users get stuck. Classic examples include:

  • Chronological Order: Sorting months correctly (January, February, March...) instead of alphabetically (April, August, December...).

  • Business Logic: Arranging business stages in their proper sequence (e.g., Lead, Opportunity, Quote, Closed-Won) instead of alphabetically.

  • Tiered Categories: Displaying service levels in a specific order (e.g., Basic, Standard, Premium).

Power BI doesn't automatically know that "Basic" should come before "Premium." You have to teach it. The secret to achieving this lies in the Sort by Column feature, which involves creating a simple "helper" column to define your desired order.

The 'Sort by Column' Solution: Step-by-Step

Let's use the most common use case: sorting months of the year correctly. Imagine you have a bar chart showing Sales by Month Name, and Power BI has sorted it alphabetically.

Step 1: Create a Sorting Column

First, we need to create a table that defines the correct order. The easiest way to do this without getting into complex DAX is by creating a simple table directly in Power BI.

  1. Navigate to the Data view on the left-hand sidebar (the little table icon).

  2. In the "Home" ribbon at the top, click on Enter data.

  3. A new window will appear, allowing you to create a small table. We'll create two columns:

    • Double-click "Column1" and rename it to Month Name.

    • Double-click "Column2" and rename it to Month Number.

  4. Now, fill in the data. In the "Month Name" column, type out the months. In the "Month Number" column, give each month a corresponding number from 1 to 12.

Example:

Month Name

Month Number

January

1

February

2

March

3

...

...

December

12

  1. Give your table a name in the bottom "Name" field, like Month Order.

  2. Click Load.

Step 2: Establish a Relationship

Now you have your main data table (with sales in it) and your new "Month Order" helper table. You need to connect them, so Power BI knows that the "January" in one table is the same as the "January" in the other.

  1. Navigate to the Model view on the left-hand sidebar (the icon with connected boxes).

  2. You will see your tables represented as boxes. Find your main data table and your new "Month Order" table.

  3. Click and hold the Month Name field in your "Month Order" table.

  4. Drag it over and drop it on top of the corresponding month name field in your main data table.

  5. A line will appear, connecting the two tables. This establishes a relationship.

Important Note: For the relationship to work, the text in both month columns must match exactly. "Jan" will not match "January." Ensure your data is consistent.

Step 3: Tell Power BI How to Sort

This is where the magic happens. We'll use the "Sort by Column" feature to link the textual "Month Name" to the numerical "Month Number."

  1. Go back to the Data view.

  2. In the "Data" pane on the right, select your original data table (not the helper table).

  3. Find and click on the column you want to sort - the one with the month names in your original table. This will highlight the whole column.

  4. A Column tools tab will appear in the top ribbon. Click it.

  5. Look for the Sort by column button. Click on it.

  6. A dropdown menu will appear. From this menu, select Month Number from your related helper table.

You may see a quick loading icon, but nothing visually changes on this screen. Behind the scenes, you’ve just told Power BI a new rule: "Whenever you see my [Month Name] column, don't use the alphabet to sort it. Use the associated [Month Number] column to get the order right."

Step 4: Update Your Chart Visual

Finally, let's see the result.

  1. Return to the Report view (the bar chart icon).

  2. Your chart might automatically fix itself. If it hasn't, just re-sort it.

  3. Select your chart, click the ellipsis ("..."), go to Sort axis, and choose your Month Name column.

  4. Make sure Sort ascending is selected.

Your bars should now magically pop into the correct chronological order: January, February, March, and so on. This same technique works for any custom order you can dream up.

Troubleshooting Common Sorting Issues

Sometimes things don't go as planned. Here are a couple of frequent roadblocks and how to fix them.

"The sort order keeps resetting when I click on something!"

If you used the basic sort options from the visual's menu to sort by value, that sort order is dynamic. Clicking a slicer or another visual can re-filter the data and cause the chart to re-sort based on the new context. The custom Sort by Column method is much more stable and is the preferred way to lock in a specific categorical order.

"'Sort By Column' is Greyed Out or Gives an Error"

This usually happens for one of two reasons:

  • No Relationship: You cannot sort one column by another if they are in two separate tables that aren't related. Double-check your Model view to ensure there's a valid relationship connecting them.

  • Many-to-Many Relationships: The data in the column you are sorting (e.g., "Month Name") must have a unique value for each value in the sort order column (e.g., "Month Number"). If you have duplicates in your lookup table (e.g., two rows for "January"), Power BI can't resolve the ambiguity. Make sure your helper/lookup table has unique category names.

Final Thoughts

Arranging the bars in your charts gives you control over your data's story, transforming a confusing visual into a clear, compelling insight. Mastering the progression from simple value-based sorting to advanced custom arrangements using the Sort by Column feature is a fundamental step in building professional-quality Power BI reports that truly speak to your audience.

While mastering tools like Power BI is incredibly valuable, we created Graphed because sometimes you just need an immediate answer without configuring helper columns or managing data models. Our platform connects directly to your marketing and sales data sources, allowing you to ask questions in plain English - like "create a bar chart of sales by month in chronological order for last year" - and get a live, interactive dashboard built for you in seconds. We automate the technical busy work so you can spend less time wrangling data and more time acting on it.