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
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
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.