How to Move Columns in Power BI
Rearranging columns in Power BI is a fundamental step for cleaning your data and preparing it for powerful analysis. A well-organized table is easier to read, navigate, and use when building visuals. This tutorial will walk you through a few different methods to move columns, from simple drag-and-drop to using the Power Query M language.
Why Does Column Order Matter?
Before we jump into the "how," let's briefly touch on the "why." You might think column order is purely cosmetic, but a logical structure has several practical benefits:
- Improved Readability: Placing key identifiers, like
CustomerIDorOrderDate, at the beginning of a table makes it much easier to scan and understand the data at a glance. - Logical Grouping: You can group related fields together. For example, keeping
City,State, andZipCodenext to each other creates a logical "address" block that is more intuitive to work with. - Efficient Data Modeling: When you're shaping your data, you might want to move columns you're working on temporarily to the front or move calculated and conditional columns to the end to review your results easily.
For these reasons, mastering a few simple column reordering techniques is a skill that will pay off every time you work on a new report.
The Right Place to Move Columns: Power Query Editor
In Power BI, there are two main environments: the main Power BI Desktop interface (with the Report, Data, and Model views) and the Power Query Editor.
While you can change the display order of fields in the Data Pane of the main interface, this is purely a cosmetic change for your convenience while building reports. It does not alter the actual structure of your data table.
For permanent, structural changes that are saved as a step in your data transformation process, you should always move columns in the Power Query Editor. This ensures that your column order is applied every time your data refreshes, creating a consistent and repeatable process. Any reordering done here becomes a formal step in the "Applied Steps" pane.
To open the editor, go to the Home tab in Power BI Desktop and click Transform data.
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: Rearrange Columns with Drag and Drop
The drag-and-drop method is the most intuitive and direct way to reorder columns in Power Query. It’s perfect for quick adjustments and provides immediate visual feedback.
Step-by-Step Instructions:
- With the Power Query Editor open, select the query (your table) you want to modify from the Queries pane on the left.
- In the data preview window, click and hold the header of the column you wish to move.
- Drag the column header to the left or right. As you move it, you will see a small vertical line or shadow indicating where the column will be placed when you release it.
- Release the mouse button once the column is in your desired position.
That's it! If you look at the Applied Steps pane on the right, you'll see a new step has been added, named "Reordered Columns." This confirms that Power BI has recorded your action.
Pro Tips for Dragging and Dropping:
- Move Multiple Columns at Once: You can move a group of columns together. Press and hold the
Ctrlkey while clicking on each column header you want to select. Once all are selected, click and drag one of them, and the entire group will move with it. - Select a Continuous Range: To select a block of adjacent columns, click the first column header, hold down the
Shiftkey, and then click the last column header in the range. All columns in between will be selected, and you can drag them as a single block.
This method is fantastic for most situations, but it can become cumbersome if you have a wide table with dozens of columns and need to move a column from one end all the way to the other.
After clicking Close & Apply, the new changes will reflect in Power BI.
Method 2: Use the 'Move' Command for Pinpoint Precision
For more control, especially in tables with many columns, Power Query provides a dedicated "Move" command. This feature allows you to instantly send a column to the very beginning or end of your table, or move it one position at a time.
How to Use the 'Move' Command:
- In the Power Query Editor, select the column (or columns) you want to move.
- Navigate to the Transform tab in the ribbon.
- Find the "Any Column" group. In this group, click the Move dropdown menu.
- You will see a few options:
Alternatively, Right-Click the Column Header
You can also access the "Move" command from a context menu. Simply right-click on the header of the column you want to move, and in the dropdown menu that appears, hover over Move to see the same options: To Beginning, To End, Left, and Right.
This method is incredibly efficient when you need to relocate a key identifier to the front or a newly created calculation to the end without the hassle of dragging it across a spreadsheet-like view.
Method 3: The Advanced Approach: Editing M Code
For those who want ultimate control or need to automate their report setup, rearranging columns directly within the Power Query M language is the most powerful option. Every action you take in the Power Query graphical interface generates M code behind the scenes. By editing this code, you can define the exact order of columns.
This is recommended for intermediate to advanced users who are comfortable with scripting.
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 to Reorder Columns in the Advanced Editor:
- After reordering your columns using one of the easier methods above, navigate to the View tab in Power Query and click on the Advanced Editor.
- In the Advanced Editor window, you will see the M code for your query. Look for a line that includes the
Table.ReorderColumnsfunction. It may look something like this:
#"Reordered Columns" = Table.ReorderColumns(#"Previous Step Name",{"Column C", "Column A", "Column B"})- Inside the curly braces
{...}is a list of your column names. You can manually rearrange the text strings in this list to set your desired order. - For example, to change the above order, you could edit the code to read:
#"Reordered Columns" = Table.ReorderColumns(#"Previous Step Name",{"Column A", "Column B", "Column C"})- Once you're satisfied with the order, click Done.
A word of caution: Be careful when editing M code. Check for syntax errors like missing commas or quotation marks, as a small mistake can prevent the query from running. Always make sure the final line of your script (the in ... statement) references the correct name of your last applied step.
Editing M code is particularly useful in scenarios where you need to enforce a standardized column template across multiple datasets or when you are building a custom function where column order is critical.
Final Thoughts
Organizing the columns in your data is a simple but important task in Power BI. By using the Power Query Editor, you can make structural, repeatable changes to your model using intuitive tools like drag-and-drop or the "Move" command. For those who need more control, manually editing the M code provides a powerful way to define an exact layout.
These data preparation steps are essential for creating clear and effective reports, but they also highlight the manual effort that goes into data analysis. To eliminate this friction, we built Graphed . Instead of spending your time in editors wrangling columns and cleaning tables, you can simply connect your data sources, ask for the dashboard you need in plain English, and have a shareable, real-time report generated in seconds.
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.