I am trying to convert some hard coded PowerQuery into a function so it can be reused, but am having an issue with the field-access-expression, as it is using the parameter's name rather than value.
This is what I've tried and I get the error "The column 'Col' if the table wasn't found"
let
table = Table.FromRecords({
[CustomerID=1, OrderID="1"],
[CustomerID=2, OrderID="2"],
[CustomerID=1, OrderID="3"],
[CustomerID=3, OrderID="4"]
}),
Col = "OrderID",
Source = Table.Group(
table,
{"CustomerID"},
{{"Orders", each Text.Combine([Col], ",")}}
in
Source
Suggestions have been to use Table.Column(table, Col) but that doesn't work for the Grouping, as it just brings them all out.