Power BITutorials

Learn How to Create Index Column Using Power Query

1 Mins read

There is one more interesting feature of Power Query where it lets you add an index column that serves as a row counter to your data.

Data Analytics Tricks in Power BI – Guidebook

You too can analyze data like a Data Scientist. No coding needed. No statistics needed.

Analyze & Visualize data using Power BI. (23 tricks in one book)

Power Query Helps To Create Index Column

Let’s go through the steps in detail with an example. Our sample data consists of Months and revenue data as shown in the picture below. Here, we want a column that counts from 1 to 12 next to our data to serve as our row numbers.

BEFORE ADDING INDEX COLUMN

Step 1: Add Index Column

After you load your data into the Power Query Editor, follow the below process to add an Index column to your data.

Add Column > Index Column > From 1

Note: You can also select the custom option instead of ‘From 1’ and set the index range of your choice.

ADD INDEX COLUMN

Step 2: Select the Index Column

As you know we always prefer the index at the beginning of the data. But after adding the Index column, it is placed at the end in Power Query as shown in the below picture. To move it to the beginning, we have to select the Index column first.

Step 3: Move Index Column to the Beginning

After selecting the Index column, move it to the beginning by performing the below step.

Transform > Move > To Beginning

MOVE COLUMN TO THE BEGINNING

Step 4: Close and Apply

After you move the Index column to the beginning of the data table in Power Query Editor as shown below, close and apply the changes for further transformations.

INDEX COLUMN MOVED TO THE BEGINNING

Data Analytics Tricks in Power BI – Guidebook

You too can analyze data like a Data Scientist. No coding needed. No statistics needed.

Analyze & Visualize data using Power BI. (23 tricks in one book)

Related posts
AlteryxTutorials

Alteryx Hotkeys - Alteryx Keyboard Shortcuts

2 Mins read
Top 50+ Alteryx Shortcuts for Windows. Alteryx is popularly known as a Self-Service Analytics tool. Business users can build their data workflows…
AlteryxTutorials

Step By Step Guide to Learn Alteryx

6 Mins read
Alteryx Learning Path: The growth in technology has resulted in growth in understanding. In today’s world, humans – fellow businessmen know the…
Excel VBA CodeTutorials

VBA Code to Clean the Date Format

1 Mins read
When it is useful? Most of the time the most annoying problem is when the data is taken from ERP or other…