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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jim_hubbardUIHS
Frequent Visitor

Help with Parameter

Hello, 

 

I am trying to pass a query parameter to a store procedure and I can get it to work in Power Query but I am trying to let the user select the parameter (A Fixed Date - End of QTR) 

 

Here is the call to the SP:

let
Source = Sql.Database("uih-sql1", "uihs_datawarehouse"),
Test = Value.NativeQuery(
Source,
"Power_BI_Get_NIRS_QTR @FiscalQTREnd",
[FiscalQtrEnd= NIRS_QTR ])
in
Test

 

I create a slicer to let the user select the date buth the data never updates...

 

I set the binding to the parmeter but the data never refreshes. 

jim_hubbardUIHS_0-1733507271184.png

jim_hubbardUIHS_1-1733507394921.png

 

 Thanks for any help... I'm missing something....

jim

3 REPLIES 3
jim_hubbardUIHS
Frequent Visitor

I tried all of the above. It seems like the parameter is working in power query, if I change it there then the stored procedure updates and returns the data, the problem appears to be in the binding of the parameter to a field. I did that but nothing changes when I choose a specific value from the slicer containg the variable. 

Anonymous
Not applicable

Hi,

Thanks for the solution TomMartens  offered, and i want to offer some more information for user to refer to.

hello @jim_hubbardUIHS , based on your descriotion, you need to add'exec .....' in your code.

e.g 

 

let
Source = Sql.Database("uih-sql1", "uihs_datawarehouse",[Query="EXEC Power_BI_Get_NIRS_QTR @FiscalQTREnd ="""& NIRS_QTR & """"]),
....
in
.....

 

And you can refer to the following link.

Power Query - Function to Execute an SQL Procedure - Hat Full of Data

Solved: Help Needed: Passing Dynamic Parameters to SQL Sto... - Microsoft Fabric Community

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

TomMartens
Super User
Super User

Hey @jim_hubbardUIHS ,

 

do you follow the steps here: https://community.fabric.microsoft.com/t5/Power-Query/Passing-PowerBI-Parameter-To-A-Stored-Procedur... and the linked post?

Keep in mind that this will only work for direct query models.

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors