Forum Discussion
Filter SQL query using parameters
- 5 years ago
Thanks edhans
In reality, that i didnt understand is what simply was to put the same name than the parameter in the powerquery and this will filter the query...
i just find the new video from Patrick that it is very visual to see what i'm looking for and for future visitors to this topic.
Thanks edhans and CNENFRNL for your support!
There are only two ways I know of dobregon
- Don't use a SQL Query but rather let Power Query create the query by query folding, which is what I've shown above.
- Read Chris's blog that CNENFRNL linked to about passing parameters to SQL queries.
I personnally prefer option 1 as it is 100% dependent on Power BI and reduces coding time - I only have M to deal with, not M and SQL, and subsequent changes in logic won't be impacted.
But I fully understand some are more comfortable with SQL, so the article linked to above would be the way to go.
Thanks edhans
In reality, that i didnt understand is what simply was to put the same name than the parameter in the powerquery and this will filter the query...
i just find the new video from Patrick that it is very visual to see what i'm looking for and for future visitors to this topic.
Thanks edhans and CNENFRNL for your support!
- Anonymous3 years agoNot applicable
Thanks for the parameters (Dates) this is helpful. Does this really impact the refresh load? As that is my expectation. So if my general ledder SQL table has 1,500,000,000 rows I and 10 years of GL data. I don't want it all and just really need Last three months of the pervious year and the current year. So two sets of parameters with from and to date each. Or is there a more lean way to parameterize this. With two datasets for GL data previous year last three months and current year; and then I append one to ther other for a sinble dataset and have one not refresh. Your thoughts. Please