In Excel Power Query, I have a table. Column A has single numbers. I want to mark those records where the Column A value matches a list. A cutdown version of the problem is:
let
TableA = Table.FromColumns({{1,2,4}}, {"A"}),
ListB = {4,5,6 },
DPart = Table.AddColumn(TableA, "IsInB",
List.MatchesAny(ListB, each _ = [A]))
in
DPart
I get an error in the DPart line
Expression.Error: We cannot apply field access to the type Number.
Details:
Value=4
Key=A
Apparently, the code is trying to access the [A] column of elements of the list, instead of the [A] column of TableA.
What I'm looking for, is the correct syntax to accomplish this.