Make Excel Power Query Use the First Row as Column Headers
Question details
Promote the first valid row of an imported text file to column headers in Excel Power Query.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- A text or CSV file is imported into Power Query and the user wants its first data row to become the field names.
- Observed behavior
- Power Query creates default names such as Column1 and Column2, or promotes the wrong row because the file contains leading blank rows, comments, or inconsistent import formatting.
Open the query in Power Query Editor and confirm which row contains the actual field names. If the source is a text or CSV file, verify its delimiter, text qualifier, and whether blank or comment lines appear before the header row.
Promote the first data row to headers in Power Query Editor
Use this when the correct header names are already visible in the first row of the Power Query preview.
In Excel, select Data > Queries & Connections, double-click the query, and open it in Power Query Editor.
Select Home > Use First Row as Headers. You can also select Transform > Use First Row as Headers.
Confirm that the displayed names match the source-file headers and that the next rows contain records rather than header text.
Select Home > Close & Load to return the corrected query results to Excel.

Remove leading rows and correct text-file import settings
Use this when a blank line, comment, incorrect delimiter, embedded line break, or encoding issue causes Power Query to identify the wrong row.
Work with Imported Spreadsheet Data in WPS Office
If you need a free, lightweight office suite for everyday spreadsheet work after importing or preparing text data, WPS Office provides a familiar spreadsheet interface and smooth migration from Microsoft Office files. Open, review, organize, and edit compatible workbook formats without changing your established workflow.

Frequently Asked Questions
Why does Power Query show Column1, Column2, and Column3 instead of my headers?
This occurs when the query has not promoted the first row. Open the query in Power Query Editor and select Home > Use First Row as Headers or Transform > Use First Row as Headers.
How do I skip a blank line before the header row in Power Query?
In Power Query Editor, select Home > Remove Rows > Remove Top Rows. Remove the blank or comment rows until the true header row is first, then select Home > Use First Row as Headers.
Can a comment line in a CSV file prevent header detection?
Yes. A leading comment line can be treated as the first row instead of the header row. Remove it in the source file or use Home > Remove Rows > Remove Top Rows before promoting headers.
What should I check when headers are split into the wrong columns?
Check the delimiter and encoding in the Source step settings. Select the gear icon next to Source when it is available, choose the correct delimiter and file origin, and confirm quoted text is using a consistent text qualifier.




