Forum Discussion
Jarrodg
2 years agoNew Member
M Lanuage code to create index values for each field value
Hi,
I am trying to write a script that will generate an index number for each value in the "Entity" field. Here is a sample of the output I want to create. I have tried using the Group function in combination with the AddIndexColumn function but I cannot get them to produce this outcome. Any suggestions please?
=Table.Combine(Table.Group(PreviousStepName,"Entity",{"n",each Table.AddIndexColumn(_,"Index",1)})[n])
1 Reply
- wdx223_DanielCommunity Champion
=Table.Combine(Table.Group(PreviousStepName,"Entity",{"n",each Table.AddIndexColumn(_,"Index",1)})[n])