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
Anonymous
Not applicable

Passing parameters to a stored procedure from the URL of a published report

I am currently trying to check the feasibility of re-creating SSRS reports as Power BI reports (not migrate as Paginated Power BI Reports). I have set up a report in the Import mode and used several stored procedures. All these work fine with default parameter values, as well as dynamic values within the Power BI Desktop. However, once I publish the report, I am unable to pass the parameter value to invoke the SP and display the data. I feel that this goes against the principle of Power BI, but I just wanted to know if there is a workaround. My ultimate aim is to embed the report in my application. The application captures the User ID of the logged in user, which inturn is used as a parameter for my stored procedure (along with several other parameters). 

Any help would be much appreciated.

3 REPLIES 3
collinq
Super User
Super User

Hi @Anonymous ,

 

Have you seen either of these articles?  They might be helpful:

Dynamic M query parameters in Power BI Desktop (preview) - Power BI | Microsoft Docs

Chris Webb's BI Blog: Using Power BI Dynamic M Parameters In DAX Queries Chris Webb's BI Blog (crossjoin.co.uk)

 

That said, if those are not helpful or get exactly what you need I was wondering about making slicers in Power BI match the Stored Procedure and then pass those slicers from the report to run the Stored Procedure?




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Anonymous
Not applicable

Hi Collin,

 

Thank you for the resources. I've gone through them and could not find much help. The Microsoft documentation mentions that it is applicable only for M based data sources and not for SQL, so I'm not sure if I could use it as I'm working with a MS SQL database. 

On the topic of creating slicers to match the stored procedure logic, I'm afraid that it isn't feasible to my requirement as the stored procedures have several dynamic statements that run into 1000s of lines of code. I'm trying to work with close to 50 SSRS reports, totalling to over 150 such parameterized stored procedures which have been vetted over years. Hence, trying my best to re-use the code instead of recreating the logic within Power BI. 

 

Not being able to call stored procedures through the DirectQuery method and not being able to pass dynamic parameters to the stored procedures through the report URL have tied my hands.

 

Power BI Paginated Reports seem to be the only feasible solution for now, although it is currently a costly solution for very little value add.

 

Any suggestion/guidance on the approach is appreciated.

Hi @Anonymous ,

 

I understand that frustration!  As far as I can tell, you can't call the Stored Procedure with Direct Query.  I am wondering if you try the Power App community - somebody there may have an answer by using Automate/Power Flow and then temporarily storing the data or otherwise passing parameters to a Stored Procedure based on URL/userid/slicer information.




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




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.

Top Solution Authors
Top Kudoed Authors