Forum Discussion

jorgen82's avatar
jorgen82
Frequent Visitor
7 years ago
Solved

Power Query: Add new column with combination of columns based on their names

Hello   I have an XML document, for which i am expanding all its elements. What i would like to achieve next is to add a new column, on which i combine the values for any other column where e.g. it...
  • Zubair_Muhammad's avatar
    7 years ago

    jorgen82

     

    Try this one

    #"step1" = Table.ColumnNames(Source),

    #"Added Custom" = Table.AddColumn(Source, "Groups", each
    Text.Combine(
    List.Transform(List.Skip(
    Record.FieldValues(Record.SelectFields(_,List.Select(Record.FieldNames(_), each Text.End(_,8)="group.id"))), each _ =""),Text.From),
    ",")
    )