This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Greetings. Using this awesome article, I was able to figure out how to add sprocs that accept parameters to my first report. However, I still have a couple questions:
--This code will show me the fields
let
Source = Sql.Database("myInstance", "myDB", [Query="exec usp_rpt_ServersDatabases"])
in
Source
--This code won't show me the fields
let
SQLSource = (dbInstance_name as text) =>
let
Source = Sql.Database("myInstance", "myDB", [Query="exec usp_rpt_ServersDatabases '"& (dbInstance_name)&"' #(lf)#(lf)"])
in
Source
in
SQLSource
Thanks!
Hi @Anonymous ,
For first question, if you mean using directquery with Store procedure please refer to the post below that makes use of OPENROWSET : https://community.powerbi.com/t5/Desktop/Calling-SQL-stored-procedure-with-Direct-Query/td-p/224831
For second question, please try to invoke the new code/function, it will generate a query with table (Step 4 in the blog)
Sorry for that we can not understand the last question clearly , do you mean how to access the Store Procedure without using sql statement in advanced editor?
Best regards,
I'm attempting to rewrite # 1 w OPENQUERY, I can make it go as long as I'm not attempting to pass in a paramter:
This works:
let
Source = Sql.Database("myServer", "myDB", [Query="select * from openquery ([myServer], 'exec myDB.dbo.usp_rpt_ServersDatabases');"])
in
Source
This doesn't:
let
SQLSource = (dbInstance_name as text) =>
let
Source = Sql.Database("myServer", "myDB", [Query="select * from openquery ([myServer], 'exec myDB.dbo.usp_rpt_ServersDatabases '"& (dbInstance_name) &"'"])
in
Source
in
SQLSource
I've attempted several variations of this, and it always yells about one thing or another. Is this possible and I'm jsut doing it wrong, or is it not possible?
Regaring # 2..
I can in fact invoke a new function which I can then Publish to my workspace. However, I then am stuck with whatever data was captured when I fed in the paramter back in Power BI Desktop -- I cannot input a new paramter and get different data.
What am I missing here?
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.