Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Power BI Community,
I am trying to import data in Power BI from a Snowflake database.
Since the Snowflake connector doesn't allow to pass SQL statements, I am using a ODBC connector to pass my SQL scripts.
As soon as I don't use variables, it's working well but when I enter SQL scripts with variables like below :
I am getting the below error :
Has anyone encountered the same issue ?
Thank you,
Arnaud
Solved! Go to Solution.
Hi @Anonymous ,
The parameter can't be directly used in sql statement window, you need to modify it in anvanced editor. Please refer to Use Case 2: Loading Dynamic Columns from the Data Source in https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Would you please try something like :
Odbc.Query("dsn=xxxx", "Select * from xxxxx where xxxxx="&Parameter&"")
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hello @v-deddai1-msft , thanks, I think it could work as a workaround but to make it simple, I would like to declare and use variables directly in the SQL statement
Hi @Anonymous ,
The parameter can't be directly used in sql statement window, you need to modify it in anvanced editor. Please refer to Use Case 2: Loading Dynamic Columns from the Data Source in https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Thank you!!
@Anonymous , I think you should pass the parameter like
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
Hi @amitchandak . Thanks but I can't use this option. The script I want to use has 12 joins on massive tables with parameters dependancies and importing those massive tables would not be possible so I really need to include parameters in the SQL statement and so import 1 single table in Power BI
Hi @Anonymous - Were you able to solve? We have similar requirement re massive table joins that need parameter driven filtering. Was thinking would be able to inject filter parameters via advanced editor as implied in above discussion.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |