Forum Discussion
Grosskopf
4 years agoNew Member
Add Column recalculates on Filter Column - faster option?
I have a query that compares a value in a row to the same value in a previous row. If the value is the same in the previous row the Add Column value is set to 0, if the value is different to the valu...
- 4 years ago
NewStep1=Table.Buffer(#"Added Index"),
NewStep2=Table.FromRecords(List.Accumulate(Table.ToRecords(#"Reorder Columns"),{},(x,y)=>if NewStep1{y[Index]}[Index]=0 or NewStep1{y[Index]-1}[Name]<>y[Name] then x&{y} else x))
wdx223_Daniel
Community Champion
4 years agoNewStep1=Table.Buffer(#"Added Index"),
NewStep2=Table.FromRecords(List.Accumulate(Table.ToRecords(#"Reorder Columns"),{},(x,y)=>if NewStep1{y[Index]}[Index]=0 or NewStep1{y[Index]-1}[Name]<>y[Name] then x&{y} else x))
Grosskopf
4 years agoNew Member
Thanks Daniel, that was perfect. Quick copy and paste and we're done.
Now I just have to work out what that code means 🙂