Forum Discussion
Use parameters in SP Power BI
Hi every one!
I want some info about use of parameters in power bi after publish the report "Publish to Portal".
- let suppose we make connectivity with sql using sp and load data successfully in Power Bi then move this file to another PC in which sql isn't connect but we still can see that data which were we load initially . By using this data I make visual or report and publish it to app.powerbi.service and embed with "Publish to Portal" and attached with Iframe in a web site. Now my requirement is. I want to use SP with 2 parameter's. How can we use it.
- Is it possible? user select two dropdown values in embedded report and get data from SP.
Hi Umair_Aslam
You may have a look at the following article about using Stored Procedure with parameters in Power BI.
Execute SQL Server Stored Procedure With User Parameter In Power BI
This will use Power Query parameters. When you publish the report to Power BI Service, you are able to change parameter values on its dataset settings page. Next time when you refresh this dataset, it will apply the new parameter values to the query and import data from the database accordingly. If your database is on the local server, you need to set up an on-premises data gateway to help perform the refresh in Power BI Service.
What is an on-premises data gateway? | Microsoft Learn
Tutorial: Refresh data from an on-premises SQL Server database - Power BI | Microsoft Learn
For the second question, I'm afraid the answer is no. Currently the closest solution is to use the Dynamic M query parameters in Power BI Desktop. However, this feature only supports DirectQuery mode while Stored Procedures are not supported in DirectQuery mode.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
2 Replies
- v-jingzhangCommunity Support
Hi Umair_Aslam
You may have a look at the following article about using Stored Procedure with parameters in Power BI.
Execute SQL Server Stored Procedure With User Parameter In Power BI
This will use Power Query parameters. When you publish the report to Power BI Service, you are able to change parameter values on its dataset settings page. Next time when you refresh this dataset, it will apply the new parameter values to the query and import data from the database accordingly. If your database is on the local server, you need to set up an on-premises data gateway to help perform the refresh in Power BI Service.
What is an on-premises data gateway? | Microsoft Learn
Tutorial: Refresh data from an on-premises SQL Server database - Power BI | Microsoft Learn
For the second question, I'm afraid the answer is no. Currently the closest solution is to use the Dynamic M query parameters in Power BI Desktop. However, this feature only supports DirectQuery mode while Stored Procedures are not supported in DirectQuery mode.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.- Umair_AslamHelper I
Hi v-jingzhang thanks for your response.