Forum Discussion
jorgen82
7 years agoFrequent Visitor
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...
- 7 years ago
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),
",")
)
Zubair_Muhammad
Community Champion
7 years ago
Basically I am using the same logic
but instead of Table.SelectColumns I am using the equivalent Record.SelectFields function
Please see the attached Excel file as well
jorgen82
7 years agoFrequent Visitor
Zubair_Muhammad thank you very very much for your help.