SOLVED

Is it possible to retrieve data from parameter table and pass into Query?

Copper Contributor

I have a parameter table defined that allows the user to define the filtering values.  I would like to take the data they've inputted and pass that into my query call.  I currently have it set to filter after the source but due to the amount of data, it's quite slow.  I'm hoping to limit the data returned for efficiency.

 

Ideally I'd like to use my current getParameterValue call to define the extra statements that would be appended on to the query (source). Is this possible? If yes, how?

 

I was thinking it would be something like this:

Source = query

#"Filter A" = query + 'and fieldA = ' + getParameterValue(FilterA)

1 Reply
best response confirmed by wowcow73 (Copper Contributor)
Solution

In general yes. Implementation depends on what you query. You may add parameter directly into your query string and/or take care about query folding to improve performance (for example https://blog.crossjoin.co.uk/2017/06/11/query-folding-and-writing-your-own-sql-queries-in-power-quer...)

1 best response

Accepted Solutions
best response confirmed by wowcow73 (Copper Contributor)
Solution

In general yes. Implementation depends on what you query. You may add parameter directly into your query string and/or take care about query folding to improve performance (for example https://blog.crossjoin.co.uk/2017/06/11/query-folding-and-writing-your-own-sql-queries-in-power-quer...)

View solution in original post