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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Truthahn195
Frequent Visitor

Power Bi and Python - Interactive user input with parameter

Hello everyone,

 

I have a python code simulating several scenarios, for which I want to display the results in Power Bi. Since the user should be able to change values of the scenarios, I created a parameter and incorporated it in the Python Code following these instructions: https://datakuity.com/2021/01/05/power-bi-pass-parameter-value-to-python-script/#Power_BI_pass_param... This works fine. However, now I am only able to change the parameter value in the Power Query Editor, and I want to be able to publish the report and make the user, who has no access to the Power Query Editor, to be able to change the parameter and hence the scenarios. How can I do this?

 

Best, Peter

1 ACCEPTED SOLUTION

Hi , @Truthahn195 

According to your description, do you want to change the value of the parameter on the dashboard?

The parameters created in Power Query are generally used to modify the data source path. And the parameters created in Power Query are currently published to Power Bi Service, and only support modification in "Paramter".

And the parameter modification in Power Query generally involves the refresh of the dataset after modification. At present, it is not possible to modify it on the report page.

For more information, you can refer to :
Parameters - Power Query | Microsoft Learn

 

Secondly, the what-if parameter in Power BI Desktop is generally used for slicers, which is equivalent to a fixed table imported into our report, and you can refer to the specific usage steps:

Power BI Parameters | How to Create and Use Parameters in Power BI? (wallstreetmojo.com)

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

View solution in original post

3 REPLIES 3
Truthahn195
Frequent Visitor

Dear Aniya,

 

thank you very much for your response. It seems to me that the user in Power Bi services has to go to the settings/configurations to adjust the value of the parameter. Is it also possible to create a slicer or something similar on the dashboard surface itself so the user can adjust the parameter without going to the setting?

When I added a parameter to the dashboard directly and added a slider to determine its value for the user in Power Bi Desktop, I was not able to insert it in the python code, therefore I wonder whether anything similar is possible.

 

Best, Peter

Hi , @Truthahn195 

According to your description, do you want to change the value of the parameter on the dashboard?

The parameters created in Power Query are generally used to modify the data source path. And the parameters created in Power Query are currently published to Power Bi Service, and only support modification in "Paramter".

And the parameter modification in Power Query generally involves the refresh of the dataset after modification. At present, it is not possible to modify it on the report page.

For more information, you can refer to :
Parameters - Power Query | Microsoft Learn

 

Secondly, the what-if parameter in Power BI Desktop is generally used for slicers, which is equivalent to a fixed table imported into our report, and you can refer to the specific usage steps:

Power BI Parameters | How to Create and Use Parameters in Power BI? (wallstreetmojo.com)

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

v-yueyunzh-msft
Community Support
Community Support

Hi , @Truthahn195 

According to your description, you create a parameter in Power Query Editor and use it in the Python code.

For this ,it works , and the parameter can be updated in Power BI Service too.

We can go to the "Parameters" setting in the dataset configuration :

vyueyunzhmsft_0-1673923212389.png

And it have the limitation:

Grayed-out fields aren't editable. Any and Binary type parameters work in Power BI Desktop. The Power BI service doesn't currently support them for security reasons.

 

For more information, you can refer to :
Edit parameter settings in the Power BI service - Power BI | Microsoft Learn

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors