Importing the first sheet in a workbook
Sometimes only the first sheet of a workbook is wanted, such as a workbook where each month’s data goes on a new sheet at the front. A query that picks the sheet by name breaks when the name changes, so this page picks it by position instead.
The method has two parts:
- Connect to the workbook, which gives a list of its sheets.
- Change the query so that it always takes the first item in that list, whatever its name.
In this example, each month has its own sheet, and the latest month, Jun, is the first tab:

The query should return the first sheet’s contents, even after a new month’s sheet is added at the front.
1. Connect to the workbook
Section titled “1. Connect to the workbook”- On Excel’s Data tab, choose Get Data ➔ From File ➔ From Workbook.
- Browse to the workbook and click Import.
- In the Navigator, click Transform Data without selecting a sheet.

The query’s Source step lists every sheet in the workbook, one per row:

The Navigator sorts the sheets by name, but the Source step lists them in the order of the workbook’s tabs, so its first row is the first tab.
2. Take the first row of the Source step
Section titled “2. Take the first row of the Source step”- Click the fx button beside the formula bar, and enter this formula as the query’s second step:
=Source{0}[Data]{0} picks the first row of Source, because Power Query counts rows from zero, and [Data] takes the table held in that row’s Data column. The step therefore always returns the first sheet, whatever it is called:
