How to Remove Query Names from Excel PivotTable Drill-Down Headers
Question details
The user wants to prevent Power Query names from automatically appearing as prefixes in the column headers when drilling down into PivotTable data.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Double-clicking a value in a PivotTable to drill down into the underlying data generated by a Power Query data model.
- Observed behavior
- The resulting drill-down table headers display the Power Query name alongside the column name, rather than just the clean column name.
Ensure you have access to the original Power Query Editor in your Excel workbook and identify exactly which column headers are displaying the unwanted query name prefix in your PivotTable.
Rename the Columns in Power Query Editor
By renaming the source columns inside the Power Query Editor before loading the data into Excel, you sever the default naming link, forcing the drill-down view to display only your custom header name.
When Excel loads a data model from Power Query and the columns retain their exact original names, the PivotTable drill-down feature often appends the query name to distinguish the data. Modifying the column name directly in M code resolves this behavior.
In your Excel workbook, navigate to the 'Data' tab on the ribbon. Click on 'Queries & Connections', find your specific query in the side pane, and double-click it to open the Power Query Editor.
Locate the column that is displaying the unwanted query name. Right-click the column header, select 'Rename', and type a new name (for instance, change 'A' to '123' or just add a space at the end).
You can also apply the renaming step manually via the formula bar or Advanced Editor. Add the step using the Table.RenameColumns function, for example: =Table.RenameColumns(Source,{{"OldColumnName", "NewColumnName"}}). Ensure you replace 'OldColumnName' and 'NewColumnName' with your actual data values.
Click the 'Close & Load' button on the Home tab of the Power Query Editor. Once the data refreshes in your workbook, double-click your PivotTable value again. The drill-down headers will now display the updated, clean names.

Simplify Data Analysis with WPS Office
If you want a straightforward way to manage PivotTables and analyze data without dealing with complex Power Query syntax and hidden data model quirks, try WPS Office. It provides a highly compatible, lightweight, and intuitive spreadsheet environment for all your daily reporting needs.
- 1. Download and Install WPS Office: Visit the official WPS website to download the free suite and install it on your computer.
- 2. Open Your Data File: Launch WPS Spreadsheet and easily open your existing Excel workbooks without losing any formatting.
- 3. Create a Clean PivotTable: Select your data range, navigate to the 'Insert' tab, and click 'PivotTable' to instantly summarize your data without complex background queries.

Frequently Asked Questions
Why does Excel add the query name to my PivotTable drill-down headers?
When source columns in Power Query retain their original structural names, the Excel Data Model sometimes appends the query or table name to ensure unique identifiers across relationships. Renaming the column forces Excel to recognize it as a distinct, user-defined field.
Will renaming the column in Power Query alter my original database?
No. All changes made in the Power Query Editor, including renaming columns, are applied only to the data loaded into Excel. Your original data source remains completely untouched.
How do I find the Advanced Editor to check my M code?
While inside the Power Query Editor, go to the 'Home' tab or 'View' tab on the top ribbon and click on 'Advanced Editor'. This will open a window displaying all the M code steps applied to your query.




