Yes—Excel Power Query keeps headers on refresh when they are defined as the query’s column names, usually by promoting the correct first row to headers. Open the query, choose Transform > Use First Row as Headers if needed, then refresh; the names remain unless the source structure or a later query step changes them.
What “keep headers” means in Power Query
Power Query treats headers as column names in a table, not as a decorative row that must be copied from the source each time. For example, if a source has the headings Order ID, Date, and Amount, promoting that first row gives the query columns those names. Refreshing reruns the query steps against the latest source data, and the header-promotion step runs again as part of that process.
This differs from manually formatting a worksheet’s first row or freezing it on screen. Power Query creates and transforms a data set; Excel displays the resulting column names when the query is loaded to a worksheet table. Freezing panes affects scrolling, not query headers. If you want worksheet headings to remain visible while scrolling, use View > Freeze Panes separately.
Headers can still change when the source changes or when the query contains steps that rename, remove, or reorder columns. So “keep headers” usually means preserving the intended column names through refresh—not forcing a query to use names that no longer match its source.
Promote the correct row to headers
For an existing query in Excel for Microsoft 365 on Windows, open Data > Queries & Connections, then double-click the query or right-click it and choose Edit. In Power Query Editor, select Transform > Use First Row as Headers. Check the preview to confirm that the first data row now contains column names and that the records start below it.
If the first row is a report title, a blank line, or other introductory text, do not promote it as-is. Remove or skip those rows first, then promote the row that contains the real field names. The order matters: promoting a title row would create columns with names such as Monthly Sales Report, while the actual labels farther down would remain in the data.
A typical sequence is:
- Open the query in Power Query Editor.
- Remove blank or introductory rows above the actual headings, if present.
- Select Transform > Use First Row as Headers.
- Review the column names and the first few records in the preview.
- Select Home > Close & Load, or use Close & Load To if you need to choose where the result goes.
The editor records the promotion as an applied step. Its underlying M expression is commonly represented as Table.PromoteHeaders(Source, [PromoteAllScalars=true]), although the exact step name and surrounding code depend on the query. You can inspect the sequence under Applied Steps; you do not need to write M code to use the ribbon command.
When the source already has headers
If the source is an Excel table with a proper header row, Power Query generally recognizes those names when it connects to the table. In that case, you usually should not promote the first data record. Promoting again can turn the first customer, transaction, or inventory record into column names and remove it from the data rows.
For a worksheet imported as a sheet rather than as a formatted Excel table, Power Query may initially show generic names such as Column1 and Column2. If the preview’s first row contains the actual headings, use the promotion command. The key is to inspect the preview rather than assuming every source needs the same operation.
Power Query may also add a Changed Type step after it identifies columns. If you promote headers after that step, the type step may refer to generic names that no longer exist. If the preview shows an error or unexpected types, check Applied Steps and move or recreate the type-setting step after the header row has been promoted.
Keep headers when combining files
Combining monthly workbooks or CSV files introduces a related issue: each file may contain its own header row. The combined result should normally contain one set of column names and only data records beneath them—not a repeated row of labels between each month’s records.
When you use Excel’s folder-combine workflow, Power Query creates helper queries and applies a transformation based on a sample file. Inspect that transformation to confirm it promotes the header row for each file in the intended way. If a repeated heading appears among the combined records, filter it out in the file-transformation logic. For example, if every file repeats Order ID in the first column, filter out rows where that column’s value is exactly Order ID, taking care not to exclude a legitimate record.
Also make sure the files have a consistent layout. If one file has a title above its headers while another begins directly with the headers, the same row-skipping rule may select different rows in each file. Standardizing the files, or adjusting the combine transformation to locate the real header row consistently, is more reliable than repeatedly correcting the final worksheet.
What happens when source headers change
A refresh does not guarantee that every old column name will survive an incompatible source change. If a source heading changes from Amount to Total, the query may show a new column name, or a later step that refers to Amount may fail. Similar problems can follow when a column is removed, duplicated, or moved into a different part of the source layout.
Column order is not always the deciding factor: many query steps refer to columns by name. But steps such as selecting specific columns, renaming fields, or setting types can depend on particular names being present. After changing a source layout, review the preview and Applied Steps for errors, missing fields, or unexpected columns rather than assuming the refresh retained the old schema.
For a stable process, agree on consistent source headings and avoid using changing report titles as headers. If the source’s names legitimately change, update the relevant query steps to reflect the new names. Renaming columns inside Power Query can give downstream users consistent labels, but the rename step itself must still be compatible with the incoming source structure.
Why headers disappear or look wrong
When headers appear as the first data row after refresh, the query may not be promoting the header row at the right point, or the source may now contain extra rows above it. Open the query and inspect the preview before and after each applied step. This identifies whether the issue starts at the source, at row removal, or at header promotion.
When column names show as Column1, Column2, or similar, the header row may not have been promoted, or the chosen row may be blank. When a record disappears, check whether that record was mistakenly promoted. When a column has a changed name or an error symbol, look for a changed source heading and for later steps that refer to its old name.
- Repeated headings in the data: filter out repeated label rows in the per-file transformation, not just in a way that handles one current output.
- Unexpected names after refresh: verify the first row in the source preview and confirm the promotion step still targets it.
- Errors after promoting: inspect later type, rename, and column-selection steps for outdated names.
- Headers absent from the worksheet: check whether the query is loaded to a worksheet table or is connection-only.
Loading and refreshing the result
After editing, Home > Close & Load returns the query result to Excel using its current column names. Close & Load To lets you choose a destination, such as a table on a worksheet or a connection-only query. A connection-only query does not display a result table on a sheet, so there will be no visible worksheet header row even though the query still has column names in Power Query.
To update a loaded result, use Data > Refresh All or right-click the output table and choose Refresh. Excel reruns the query and replaces or updates its output; it does not treat a manually edited worksheet header as the authoritative query definition. Make header changes in Power Query if they need to persist, rather than typing over the table headings after loading.
Refresh behavior can also depend on source access, credentials, and connection settings. If the data does not update, distinguish a header problem from a refresh failure: check for an error message, confirm the source is reachable, and then inspect the query preview. On Mac, Power Query availability and commands can differ by Excel release and source connector; use the desktop Power Query editor where available. Excel for the web is not a full substitute for desktop query editing, so edit complex queries in desktop Excel.
Good habits for reliable headers
A few choices make refreshes easier to maintain:
- Use a clear, single header row with unique, nonblank names in the source.
- Convert recurring Excel data ranges into Excel tables before connecting, when that suits the workflow.
- Remove title rows and blank rows before promoting headers.
- Keep column names and layouts consistent across files that will be combined.
- Review the query preview and Applied Steps after changing a source template.
- Keep manual presentation choices, such as freezing panes or applying worksheet formatting, separate from Power Query transformations.
These practices help because Power Query refreshes a sequence of transformations, not a frozen copy of the first successful result. A well-defined header step makes the intended structure repeatable; consistent source data makes that step dependable.
Frequently Asked Questions
Does Power Query keep headers when I click Refresh All?
Yes, if the query has a header-promotion step and the source still has the expected layout. Refresh reruns the steps. A changed or missing source heading can affect later steps.
How do I stop the first data row from becoming a header?
Do not promote headers if the source already supplies column names. If a promotion step is present, inspect Applied Steps and remove or correct it; then refresh and check that the first record is back in the data.
Why do I see Column1 and Column2 instead of my headings?
The source row containing the headings may not have been promoted, or it may not be the first row when the query reaches that step. Remove preceding rows if necessary, then use Transform > Use First Row as Headers.
Can I rename headers in Power Query and keep those names?
Yes. Rename the columns in the query so the rename is part of its applied steps. If the incoming source columns later change, review that step because it may depend on the original names.
Why are header rows repeated when I combine files?
Each file may contribute its own heading row as data. Check the helper transformation used for the files and filter out repeated heading records while retaining the single set of column names.
Related
- Excel Page Break Dashed Line: What It Means
- Excel Power Query Editor: How to Open It
- Excel Open Shortcut Keys for Windows and Mac Users
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Create a Calendar Template in Word That You Can ReuseTo create a reusable calendar template in Word, make a seven-column table for the days of the week,…
- Compare Documents in Word and Create a RedlineTo compare two versions of a document in Microsoft Word, open Word and choose Review > Compare >…
- How to Delete a Whole Page in Word Without Losing TextTo delete a whole page in Microsoft Word, place the cursor on that page, press Ctrl+G on Windows…
- Personal Signature in Outlook: How to Create and Set It UpCreate a personal signature in Outlook by opening the signature settings for your version, adding your contact details…
- Access Text to Columns: Split Data in a FieldMicrosoft Access does not have an existing-table command named Text to Columns like Excel does. To split a…
- Edit a Dropdown List in Excel: Sources, Steps, and FixesTo edit a dropdown list in Excel for Microsoft 365 on Windows, select a cell that uses it,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.