Skip to main content

How to add a column with a unique row id/number?

Table of Contents

The Index Column feature in Power BI allows you to add a column that assigns a unique row ID to each entry.

  • Under the Home tab, click Transform Data to open the Power Query Editor.
  • In the Power Query Editor, select the table or query where you want to add a unique row ID.
  • Go to the Add Column tab and click Index Column.

You can choose from the following options in the dropdown:

  • From 0: This option starts the index at zero.
  • From 1: This option starts the index at one.
  • Custom: This option allows you to define a custom starting value and increment. The default increment is 1, but you can change it in the Power Query code.
  • After making your selection, click Close & Apply to save your changes.

    Add comment