Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
compscinj
Frequent Visitor

Query Parameters Not Bound - Oracle Database

I have a report that is running a query against an Oracle Database. The query has a few filters that are often changed, so in other environments those are stored as variables. As I understand it from my research, Power BI does not accept the use of the "DECLARE" statement for Oracle Databases. 


After watching this video from Guy in a Cube, https://www.youtube.com/watch?v=iiNDq2VrZPY, I tried doing the same thing the video does at the beginning (Using a Power BI Query Parameter, can be found around 2 minutes) however I get the error that the variable is not bound. The only difference I can see between what I am doing and what Patrick is doing is that he is querying a MySQL database and I am querying an Oracle database. Does Power BI not support the same use of parameters for both? 

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @compscinj,

 

To reference a query parameter in query statement Where clause, we need to modify Power Query below: 

 

q3.PNG

 

Best Regards,
Qiuyun Yu 

 

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-qiuyu-msft
Community Support
Community Support

Hi @compscinj,

 

To reference a query parameter in query statement Where clause, we need to modify Power Query below: 

 

q3.PNG

 

Best Regards,
Qiuyun Yu 

 

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Worked perfectly, thank you!

v-qiuyu-msft
Community Support
Community Support

Hi @compscinj,

 

Based on my test, I also get error when reference query parameter in Where clause. I have sent a email to consult this issue internally, will update here once I get any information. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
compscinj
Frequent Visitor

I am not calling a stored procedure (though I am working on something like that for another dashboard), but instead using parameters declared in Power BI directly inside my query. 

 

An example would be if I have a parameter I declared in Power BI called Sales_Threshold, and gave it a value of 50,000. I then have a query that pulls data with a WHERE clause that says Sales > 50,000. Instead of writing 50,000, I would prefer to write Sales_Threshold so if it never needs to be changed I can just change the parameter in Power BI instead of changing every instance of the number in the query. 

Vicky_Song
Impactful Individual
Impactful Individual

 
v-qiuyu-msft
Community Support
Community Support

Hi @compscinj,

 

In Power BI desktop, when you get data from Oracle database, do you call a stored procedure or get data from a table?

 

If it's stored procedure, would you please share us the query how you create that stored procedure on Oracle side? 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.