Introduction

Power BI offers with the Power Query Editor a powerful tool for cleaning and transforming data. One important part of data preparation is adding an Index Column. For organizing and structuring your data it is crucial that every row is uniquely identified by an ID. An Index Column enables you to uniquely identify each data record and maintain the row order. In this tutorial, we show you how to create an Index Column in Power Query.

Data

The data for this tutorial comes from an Excel file. In the following tutorial, we have shown how to import Excel into Power BI:

Power BI - Import Data from Excel file
Introduction In this tutorial, we want to import Data from a Excel file into Power BI. This can be easily done in the Power BI Desktop interface. Data Source Our data source is the Excel file student. The file contains the following data: Power BI Desktop In the following, we

We have loaded the data into Power BI but we haven't executed any transformations on the data. The data looks as follows:

As you can see, the dataset does not contain an ID column. However, such a column is important in order to uniquely identify each data record.

Let's explore how to add an Index Column with Power Query.

Open Power Query Editor

First, we open the Power Query Editor by clicking on "Transform Data":

This takes us to the Power Query Editor interface:

💡
All steps that are performed are displayed on the right-hand sidebar. You have the opportunity to undo steps at any time.

Add Default Index Column

In order to add a Default Index Column, we select "Index Column". We can choose whether the index should start from 0 or 1. We want an index that starts from 1, so we choose "From 1":

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In