In Power Query, how can I add a column which merges columns based on a list (so the list of column names gets merged)?
If done manually, I would have
Instead, I want that list of Column1...Column4 to be a list that I feed into Text.Combine, but since it's referencing columns, it doesn't work to just provide a list
I tried the following method, but it is extremely slow (the manual method loads in 2-3 seconds, this method takes minutes)
There must be a better (faster) way?
If done manually, I would have
Code:
let
Source = Input_Original,
#"Added Key" = Table.AddColumn(Source, "Key", each
Text.Combine(
{ [Column1], [Column2], [Column3], [Column4] },
" - "
))
in
#"Added Key"
Code:
{"Column1", "Column2", "Column3", "Column4"}
Code:
let
Source = Input_Original,
#"Added Key" = Table.AddColumn(Source, "Key", each
Text.Combine(
Record.FieldValues(Record.SelectFields(_, KeyColumns_List, MissingField.Ignore)),
" - "
))
in
#"Added Key"