Forum Discussion
Concatenate values from child records while expanding from merged query
- 7 years ago
For your purpose, "Table.ExpandTableColumn" is the wrong command, as you don't want an expansion, but an aggregation instead.
Using the UI, you have the option to select an aggregation instead:
You can either use one of the default-options and then tweak the code:
Table.AggregateTableColumn(#"Merged Queries", "Table2", {{"ROUTING_ID_To", each Text.Combine(List.Transform(_, (x) => Text.From(x)), ","), "Desired Result"}})or simply add a column with the code v-juanli-msft has provided already (Text.Combine[MergedChildTableColumn], ","). That delivers the desired result and you simple remove the merged column afterwards.
For your purpose, "Table.ExpandTableColumn" is the wrong command, as you don't want an expansion, but an aggregation instead.
Using the UI, you have the option to select an aggregation instead:
You can either use one of the default-options and then tweak the code:
Table.AggregateTableColumn(#"Merged Queries", "Table2", {{"ROUTING_ID_To", each Text.Combine(List.Transform(_, (x) => Text.From(x)), ","), "Desired Result"}})
or simply add a column with the code v-juanli-msft has provided already (Text.Combine[MergedChildTableColumn], ","). That delivers the desired result and you simple remove the merged column afterwards.