Forum Discussion
Using a list parameter as a table filter in M language
- 8 years ago
You nee to use List.ContainsAny() function. *** MAKE SURE you wrap your field name in curly brackets.
= Table.SelectRows(
PreviousStep,
each List.ContainsAny( { 543,95,96,1359,1360,1104 } , { [CodeValueField] }
))Results returned :
543 95 96 1359 1360 1104 where CodeValueField field contains all the values below:
CodeValueField
543 95 96 1359 1360 1104 1170 1172 93 1248 454 1361 92 97 -4 -3 -5 -7 -8 -2
Hey nickchobotar,
Sorry, that doesn't work..what I am trying to do is use a list instead of providing hardcoded values. The function works fine if you have the values hardcoded..I am trying to have it work like this:
each List.ContainsAny(myListNameHere, { [CodeValueField]})
..reason for this is so that it can be a parameter (instead a hardcoded value)
My bad--it does work!! I must have had an issue transforming to a list but just ran it again reference another parameter list and it worked!! Thanks so much for the help, I will accept this as the solution.
- nickchobotar8 years agoSkilled Sharer