Forum Discussion
JuanSombrero
9 years agoFrequent Visitor
Pass a list as filter argument in Power Query
Hi all, I have a fact table with transactions (sales and product numbers), and a second list of 'required product numbers'. This list is dynamic and can change every time I use the report. I want...
- 9 years ago
This would be the way:
= Table.SelectRows(factSales, each List.Contains(requiredProductNumbers, [Product]))
Anonymous
8 years agoNot applicable
Having the same issue here, have been trying to figure this out all morning.
No luck! If someone could elaborate futher it would be appreciated greatly.
dslForPBI
8 years agoHelper I
Hello--sorry I missed this somehow--happy to oblige though!! Here is a code snippett below which should give you what you want:
//
//Use the parameter list to feed code values...
//
tblIncludeStates = Table.SelectRows(tblFromDownload, each List.ContainsAny({MyCodeList} ,{[Outstate_Code]})),
..the "MyCodeList" is my list of codes..the "ContainsAny" is the m function/method that did the trick for me..you might also look at the type you used for the list and make sure it coincides with the type you are looking to iterate over.
- LuisPaimBR4 years agoNew Member
Hi! Can I do that with query folding on Oracle DB?
- Deano7773 years agoNew Member
I still get no results on this
- prafael3 years agoFrequent Visitor
For the colleague's code to work you need to convert the table with the values to be filtered to a list or replace requiredProductNumbers with a list, for example, {"Product1", "Product2", "Product3",...,"Productn"}