Forum Discussion
Power BI Slicer as What-If parameter in python script
- Anonymous3 years ago
Hi Anonymous ,
It depends on the purpose of your Python script.
You can either pass arguments to "Run Python Scripts" or to "Power BI Queries".
Passing command-line arguments
Let's suppose you run a Python script like explained in Run Python Scripts in Power BI Desktop - Power BI | Microsoft Docs or How to run Python Script on powerBI
Since the script is called like a regular program from a command-line there can also be passed command-line arguments to the script. Those arguments can then interpreted by your Python script as parameters.
Here are some similar case that you can refer to : Solved: Slicers as input for Python script - Microsoft Power BI Communit, powerbi - Pass variable value to a Python script via Power BI - Stack Overflow
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
It depends on the purpose of your Python script.
You can either pass arguments to "Run Python Scripts" or to "Power BI Queries".
Passing command-line arguments
Let's suppose you run a Python script like explained in Run Python Scripts in Power BI Desktop - Power BI | Microsoft Docs or How to run Python Script on powerBI
Since the script is called like a regular program from a command-line there can also be passed command-line arguments to the script. Those arguments can then interpreted by your Python script as parameters.
Here are some similar case that you can refer to : Solved: Slicers as input for Python script - Microsoft Power BI Communit, powerbi - Pass variable value to a Python script via Power BI - Stack Overflow
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.