Forum Discussion
dslForPBI
8 years agoHelper I
Using a list parameter as a table filter in M language
I have an M language query in which I would like to use list values from a parameter list. Each attempt causes only the default or current item to be read. Is it possible to pull all the items from t...
- 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
Anonymous
7 years agoNot applicable
Great info...
Just wanted to know what if your parameters were text-based? I having issues getting the quotation marks to work
nickchobotar
7 years agoSkilled Sharer
Anonymous My solution was with numeric values. However, List.Contains + All or + Any functions work with strings too. Try wrapping in double quotes the text with quotation marks like so :
Source
| a |
| "b" |
| c |
= List.ContainsAny(Source, { """b"""})
N -