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.

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

To get in-depth knowledge of Power Query in Excel and Power BI, then check out our latest Power Query Course with Certification. In this course, you will learn data cleaning and data transformation techniques that help to organize the data in excel and Power BI.

You can gain more knowledge :

Related posts
Power BITutorials

Opportunity Analysis Power BI Dashboard

1 Mins read
Information: A software company that has two sales channels: direct and partner. The sales manager created this dashboard to track opportunities and…
Power BITutorials

Procurement Analysis Power BI Dashboard

1 Mins read
Information: It analyzes a manufacturing company’s spending on vendors by category and location. we explore these areas: Who the top vendors are…
Power BITutorials

Retail Analysis Power BI Dashboard

1 Mins read
Information: It analyzes retail sales data of items sold across multiple stores and districts The metrics compare this year’s performance to last…