Reputation: 55
I have a column in a table that indicates a group identification and I would like to generate an index that goes from 1 to the number of times that group appears, for each of the groups. And then of course there are other columns with data
Example:
So, how do I generate the Index column from the Group ID column?
Upvotes: 0
Views: 2628
Reputation: 21393
Right click Group ID, Group By, keep name, use operation All Rows
Change the code in the window from
= Table.Group(#"Changed Type", {"Group ID"}, {{"Count", each _, type table ....
to
= Table.Group(#"Changed Type", {"Group ID"}, {{"Count", each Table.AddIndexColumn(_, "Index", 0, 1, Int64.Type), type table}})
Expand using arrows atop column
Upvotes: 1