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 a Power Query, you can add an Index column to your data that serves as a row counter to rows in data table, that mean 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 appear > Select your dataset > Add Column > Index Column

Index Column in Power BI

Index Column in Power BI



Step-3: Index column gives you three option 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

Add Index Column dialogue box appears, here we have provided index starting 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.

Leave a Reply