Create an index column to show the number of a row in a query. This is especially useful when you are filtering by row position or by a range or rows. The index column can help you confirm your results. An index column is also added to an Excel worksheet when you load it.
Procedure
-
To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel (Power Query).
-
Select Add Column > Index Column. The default behavior is to start numbering the first row at 0. Alternatively:
-
If you select the arrow and select From 1, you can start numbering the rows at 1.
-
If you select the arrow and select Custom, you can enter a Starting Index and Increment to specify a different starting number and way to number each row. For example, if you enter the numbers 2 and 2, the rows are numbered as 2, 4, 6, and so on.
-
Result
A column named Index is added to the end of the query. You can drag and drop the new column to a different location if you want. You can also rename the column. For more information, see Rename a column.