How to Rearrange Columns in Power BI Matrix

Cody Schneider

Ever found yourself staring at a Power BI matrix, frustrated because the columns are in the wrong order? You're not alone. Power BI is fantastic for creating dynamic reports, but its tendency to sort things alphabetically by default can make even the simplest matrix look confusing. This guide will walk you through exactly how to take control and arrange your matrix columns in a logical, intuitive way.

We'll cover the two main scenarios you'll face: rearranging the high-level column fields themselves and defining a completely custom sort order for the values within a field (like sorting months chronologically instead of alphabetically).

Understanding Why Power BI Sorts Columns the Way It Does

Before fixing the problem, it helps to understand why it happens. When you add a field to the "Columns" well in a matrix visual, Power BI looks at the text values in that field and, by default, sorts them alphabetically. This is why "April" comes before "January," and a product size like "Large" might appear before "Medium."

The same logic applies if you have multiple fields stacked in the columns well. Power BI will display them in the order they are stacked in the Visualizations pane. While this default behavior is predictable, it’s rarely what you need for a polished and easy-to-read report. Fortunately, there are straightforward ways to override this and tell Power BI how you want your data displayed.

Method 1: The Simple Drag-and-Drop (For Reordering Field Hierarchy)

Let's start with the easiest fix. This method applies when you have multiple fields creating your column structure, and you just want to change which field comes first.

Imagine your matrix columns are structured by Year and then broken down by Product Category. The columns might look like this: 2023 - Accessories, 2023 - Bikes, 2023 - Clothing, 2024 - Accessories, and so on. But what if you wanted to see the categories grouped together, like: Accessories - 2023, Accessories - 2024, Bikes - 2023, Bikes - 2024?

This is a simple hierarchy change, and you can do it right in the report builder.

Step-by-Step Instructions

  1. Select your matrix visual on the report canvas.

  2. In the Visualizations pane on the right, look for the "Columns" well. You will see your data fields listed there (e.g., "Year" and "Product Category").

  3. The field at the top of the list is the highest level in the hierarchy. In our original example, "Year" would be on top of "Product Category."

  4. To change the hierarchy, simply click and drag the "Product Category" field and drop it above the "Year" field within the "Columns" well.

That's it! Power BI will instantly update the matrix visual to reflect the new hierarchy, grouping first by Product Category and then by Year. This is the go-to method for reordering the levels of your columns.

Method 2: The "Sort by Column" Feature (For Custom Column Order)

This is where the real power lies. What happens when the order within a single field is wrong? The classic examples are months of the year, product sizes (Small, Medium, Large), or survey responses (Dissatisfied, Neutral, Satisfied).

Alphabetical sorting scrambles these into an illogical order. To fix this, we need to create a "helper" column that defines the correct order and then tell Power BI to use it for sorting.

Let's walk through the most common use case: sorting months chronologically.

The Problem: Sorting Months Chronologically

You have a sales matrix with "Month Name" as a column. Power BI displays them as: April, August, December, February...

Your goal is to see: January, February, March, April...

To do this, you need to associate each month's name with a number (1 for January, 2 for February, etc.) and instruct Power BI to use that number for sorting.

Step 1: Create a Helper Column or Table

The cleanest way to do this is by creating a new table in your data model that acts as a lookup or dimension table. This is a best practice in data modeling because it keeps your logic separate and reusable. We'll use the "Enter Data" feature for this.

  1. Navigate to the Data view in Power BI (the small table icon on the left-hand navigation pane).

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

  3. A "Create Table" window will pop up. You'll create two columns:

    • Give the first column a name like MonthName. Enter the names of the months exactly as they appear in your main data table (e.g., "January", "February", "March").

    • Give the second column a name like MonthNumber. Enter the corresponding sort order for each month (1, 2, 3...).

  4. Name your new table something logical, like "Month Lookup" or "Date Dimension," and click Load.

You now have a simple lookup table that defines the correct sort order for your months.

Step 2: Create a Relationship Between Your Tables

Next, tell Power BI how your new lookup table relates to your main data table.

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

  2. Find your main data table and your new "Month Lookup" table.

  3. Click and drag the "MonthName" field from the lookup table onto the "Month Name" field in your main data table.

  4. A line will connect the tables, signifying a relationship. Power BI now understands that "January" in one table is the same as "January" in the other.

Step 3: Apply the "Sort by Column" Setting

Now, set the column to sort your month names according to the helper column.

  1. Return to the Data view.

  2. Select your main data table, then click on your "Month Name" column.

  3. In the ribbon, go to the Column Tools tab.

  4. Click Sort by Column dropdown and select MonthNumber.

  5. Power BI will work briefly, applying the sort order behind the scenes. You won't see changes immediately, but the sorting is now configured.

Step 4: Verify Your Matrix

Go back to the Report view. Your matrix visual should now display months in correct chronological order from January to December, overriding the default alphabetic sort.

Applying the Method to Another Example: "T-Shirt Size"

This same "helper column" principle works for any custom text sorting.

  • Goal: Sort "T-Shirt Size" in order: Small, Medium, Large, X-Large.

  • Problem: Power BI sorts alphabetically: Large, Medium, Small, X-Large.

  • Fix:

    1. Create a lookup table with sizes and their order (Small=1, Medium=2, Large=3, X-Large=4).

    2. Build a relationship between this table and your sales data.

    3. Use "Sort by column" on your size column to sort by the "SizeOrder" field.

Common Troubleshooting Tips

"Sort by Column is Greyed Out"

This usually happens because:

  • You haven't selected the column you want to sort.

  • There are duplicate values in your sorting column. The sort column must have a unique value for each sort item, e.g., only one number for each month name.

"My Sort Order Didn't Change"

If steps are followed but the visual doesn't update:

  • Check relationships are correct and unique.

  • Ensure spelling matches exactly, with no extra spaces. Use Power Query's Trim and Clean functions to fix mismatches.

Final Polish: Hiding the Helper Column

Once your sort order is working, hide the helper column to keep your data tidy:

  • In the Data or Model view, right-click the helper column and select Hide in report view. It remains usable for sorting but won't clutter your report fields.

Final Thoughts

Reordering columns in a Power BI matrix relies on two main techniques: a simple drag-and-drop for hierarchical changes and the powerful "Sort by Column" method for custom sequences. By creating helper tables and establishing relationships, you can make your reports clear, professional, and easier to interpret.

While mastering these techniques enhances your reporting skills, it also reveals how many manual steps are often needed to produce polished results. To streamline this process, we built Graphed — a tool that removes this friction. Connect your data sources and simply ask in plain English: "Show me total sales by month for last year as a bar chart, with months in chronological order." It manages sorting, visualization, and data connections instantly, turning hours of work into seconds.