Forum Discussion
Anonymous
3 years agoNot applicable
Recursive issue
Hello everyone, I have a table similar to this one : So the first column is the name of an object and the generation (I, II, III, IV, ...), second column correspond to the previous generatio...
wdx223_Daniel
3 years agoCommunity Champion
try this M code
NewStep=let gens={"IV","III","II","I"} in #table(Table.ColumnNames(PreviousStepName),List.TransformMany(Table.ToRows(PreviousStepName),each let a=List.Skip(gens,(x)=>not List.Contains(Text.Split(_{1}," "),x)) in if a={} then {_} else List.Transform(a,(x)=>Text.Combine(Splitter.SplitTextByAnyDelimiters(gens)(_{1}),x)),(x,y)=>{x{0},y,x{2}}))