Forum Discussion
Power Query: Add new column with combination of columns based on their names
- 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),
",")
)
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_Muhammad7 years ago
Community Champion
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
- jorgen827 years agoFrequent Visitor
Zubair_Muhammad thank you very very much for your help.