Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Power Query - Row Number by Group on Tables

Hello, 

I have imported multiple tabs from a file using 'import from folder'. Each tab was loaded in as a table, and then I expanded them to combine into one data set. How can I create row numbers so that each tab starts at 1?

 

1. Dataset loaded in from file using import from folder.

2. I pressed the expand button on top of custom to get each tab of the data set

3.

I have a table with every row from each of the tables.

How can I get an index for each table? For each table it starts over at 1?

ex

tabA 1
tabA 2

tabA 3
Notes 1
Notes 2

Notes 3
_Assumptions 1
_Assumptions 2

  • Before you expand those "Table"s you can add a custom column with Table.AddIndexColumn([Custom.Data], "Index", 1,1), remove the original column and then expand the new one.

     

    Pat

     

1 Reply

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Before you expand those "Table"s you can add a custom column with Table.AddIndexColumn([Custom.Data], "Index", 1,1), remove the original column and then expand the new one.

     

    Pat