Home » Power BI » Creating an Index column using a Power Query

Creating an Index column using a Power Query

Index column in Power BI example

Using Power Query, you can add an Index column to your data that serves as a row counter for the rows in the data table. This means you can add a Serial Number or Row Number column in Power BI.

Note: It does not support Direct Query mode.

Let’s get started-

Follow these steps in order to create an Index column-

Step-1: Under Home Tab > Click on Transform data > Select Transform data

Transform Data

Transform Data

Step-2: Power Query Editor windows appears > Select your dataset > Add Column > Index Column

Index Column in Power BI

Index Column in Power BI



Step-3: The index column provides you with three options as follows:

  • From 0 – It adds index starting from 0.
  • From 1 – It adds index starting from 1.
  • Custom – It gives you ability to set index starting number and increment.

Start Index From 0 & From 1

Click on Add column > Index Column > choose ‘From 0’ or ‘From 1’

Power BI Index column

Power BI Index column

Custom Index

Click on “Add Column” > “Index Column” > choose “Custom Index.”

The “Add Index Column” dialogue box appears. Here, we have provided the starting index number as 1 and want it to be incremented by 2.

That means each next rows will have an index number that is incremented by 2 to the index number of previous row.

Custom Index Column in Power BI

Custom Index Column in Power BI

See the final output

Index column PowerBI

Index column Power BI



How to move new created Index column to the beginning?

Select the column > click on Transform Tab > Click on Move Icon > Choose To Beginning.

You can also move multi column together, select multiple column to using Ctrl + Click.

Move Column in Power BI

Move Column in Power BI

Refer Power BI other post: Power BI tutorials

Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our Contact form , we will revert to you asap.

1 thought on “Creating an Index column using a Power Query”

  1. Will adding an index in power query and ordering it by index in ascending order there ensure that the same order will be maintained in the data view as well in Power BI?

Leave a Reply