Forum Discussion
taskob
1 year agoFrequent Visitor
ListName from parameter
Hi All, I would like to use a Parameter (List_Param) instead of hardcoding the name of my list to filter out some of the rows from several tables in the model. #"Remove Rows" = Table.SelectRows(#"...
- 1 year ago
You are right taskob, but you can do it this way (it works also in Power BI)
I've hardcoded your lists into a table. See attached .pbix file.
PwerQueryKees
1 year agoSuper User
I do not know your use case, but there may be alternatives to Expression.Evaluate() you may want to consider, because Expression.Evaluate() sometimes causes security errors:
- If you list is a column of a table you could use Table.Column to access it by name
- If your list is a variable in your function, instead of assigning the name of the list to the parameter, assign the list to it.
- if your list(s) are separate queries, combine them in 1 record that can be a sperate query.
[
list 1 = {1,2,3},
List 2 = {"a", "b", "c"}
}Acces any individual list with Record.Field
Hope this helps.