top of page

You are learning Power Query in MS Excel

How to rename, reorder, or hide columns in Power Query?

In Power Query, you can easily rename, reorder, or hide columns to prepare your data for analysis or reporting. Here’s how you can perform these operations step-by-step using the Power Query Editor in Excel:

Renaming Columns

1. Open Power Query Editor:
- Load your dataset into Excel.
- Go to the `Data` tab and click on `Get & Transform Data` > `From Table/Range` to open the Power Query Editor.

2. Rename a Column:
- In the Power Query Editor, select the column header you want to rename.
- Right-click on the column header and choose `Rename`.

![Rename Column](https://i.imgur.com/w5fCtS4.png)

3. Enter New Name:
- Type the new name for the column and press `Enter` to apply the change.

![Enter New Name](https://i.imgur.com/Am9fLbx.png)

4. Apply Changes:
- Power Query automatically applies the rename operation. There’s no need to confirm or save the change manually.

Reordering Columns

1. Reorder Columns:
- To reorder columns in Power Query, click and drag column headers to rearrange them in the desired order.

![Reorder Columns](https://i.imgur.com/6OjMZmA.png)

- Alternatively, right-click on a column header and select `Move Before` or `Move After` to specify the position relative to another column.

![Move Column](https://i.imgur.com/njNzKbt.png)

- Power Query updates the column order immediately as you make changes.

Hiding Columns

1. Hide Columns:
- To hide a column in Power Query, right-click on the column header and select `Remove`.

![Hide Column](https://i.imgur.com/c2KsRA6.png)

- Alternatively, you can also click on the column header to select it, then go to the `Home` tab and click on `Remove Columns` > `Remove`.

![Remove Columns](https://i.imgur.com/YQwQrM9.png)

- Hidden columns are excluded from the output data when you load or transform it.

Example: Renaming, Reordering, and Hiding Columns

Suppose you have a dataset `SalesData` with columns `OrderID`, `CustomerID`, `Product`, `Quantity`, and `Revenue`. To rename the `OrderID` column to `OrderNumber`, reorder columns, and hide the `CustomerID` column:

1. Open Power Query Editor:
- Load `SalesData` into Power Query.

2. Rename Column:
- Right-click on the `OrderID` column header, choose `Rename`, and enter `OrderNumber`.

3. Reorder Columns:
- Click and drag columns to reorder them as needed.

4. Hide Column:
- Right-click on the `CustomerID` column header and select `Remove`.

5. Apply Changes:
- Power Query updates column names, order, and visibility instantly.

6. Load Data:
- Click `Close & Load` to apply changes and load the refined data into Excel.

Summary

By following these steps, you can efficiently rename, reorder, or hide columns in Power Query to tailor your dataset for analysis or reporting purposes. These operations are crucial for data preparation, ensuring that your Excel workbooks contain the necessary and organized data needed for your tasks.

bottom of page