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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.