0
votes

Morning everyone,

I wish you a merry christmas in advance. I need help with Power Query Custom Column.

I would like to have the num_ech as you can see in the picture below which will be dynamically incremented by + 1 according to the id which also changes. As the data will continue growing I'd to create it in Power Query Custom Column. enter image description here

1
Can you add another column with your expected value?mkRabbani
requirement is as good as adding 1 for all rows, correct?Siva
@Siva OP is trying to index the id column, not create a constant 1 column.Alexis Olson

1 Answers

1
votes

right click the id column and group by. accept all defaults and hit ok

in code window (or home ... advanced editor) change code from something that looks like this

= Table.Group(#"Changed Type", {"id"}, {{"Count", each Table.RowCount(_), type number}})

to this

= Table.Group(#"Changed Type", {"id"}, {{"data", each Table.AddIndexColumn(_, "num_ech", 0, 1), type table}})

then use arrows atop the column to [x] expand everything except id