Add Index Column in #Excel using #PowerQuery

In Power Query, it is a super easy task to add a column of sequential numbers. We can do it by adding an Index Column. There are three options for adding Index Column:

  • From 0
  • From 1
  • Custom (both starting and increment value are customizable), using this option may not give you a column of sequential numbers as you can customize incremental values other than 1.

This can be demonstrated in a 1-minute video, even without narrative. (I was lazy indeed๐Ÿ˜…)

However, adding an Index Column alone by itself may not be helpful, unless you simply want to assign a surrogate key to a table. (Tip: Adding Index Column using Power Query ensures you will get an updated list of sequential numbers all the way to the last record in the table.)

Having said, adding an Index Column, as a helper step, could be super helpful in many scenarios. You may refer to the following videos to see some use cases for it.

Dense Ranking with Power Query

Unstack Uneven Data with #Excel #PowerQuery

Power Query Challenge by Computergaga – Who eats what (Stacking irregular table)

Power Query Challenge from Mr Excel – Reshaping data

The power of Excel

A single function itself may not be useful. Sometimes you may even wonder why there is such a function. The power of Excel will be multiplied when multiple functions/features being used together, wisely. ๐Ÿ˜‰

How do you use add Index Column in Power Query? Please share with us by leaving comments below.


About MF

An Excel nerd who just transition into a role related to data analytics at current company......๐Ÿ˜Š Recently in love with Power Query and Power BI.๐Ÿ˜ Keep learning new Excel and Power BI stuffs and be amazed by all the new discoveries.
This entry was posted in Power Query and tagged , . Bookmark the permalink.

Comments, suggestions, corrections are welcome.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.