Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Split variables and associated values into separate columns

Hi! I have this particular table: Variables Values new person 4 new person 9 new person 8 new person 2 old person 5 old person 1 old person 7 old person 3   ...
  • wdx223_Daniel's avatar
    3 years ago

    =Table.FromColumns(List.Combine(Table.Group(PreviousStepName,"Variable",{"n",Table.ToColumns})[n]),List.TransformMany({0..List.Count(List.Distinct(PreviousStepName[Variable]))-1},each Table.ColumnNames(PreviousStepName),(x,y)=>if x=0 then y else y&"_"&Text.From(x)))