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.
Hi all,
I am running a python script on a dataset fetched from SQL db connection in power bi. I am able to return a dataframe/table and visualize it but I would like to give the ability to user to define the results based on visual slicers in the report. The slicer selection should be input for python function.
I have seen that there is a possibility to create parameter but i would like to connect this parameter with a slicer in the GUI.
Do you maybe have a solution for this?
Many thanks in advance!
Elria
Hi, @elria
I assume that you want to use query paramters with python scripts to get the corresponding result. I'd like to suggest your refer the following links to see if it helps.
Deep Dive into Query Parameters and Power BI Templates
Power BI Desktop Query Parameters
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@elria , is this what you are looking for
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals
Age and weight are passed to python
Hi @amitchandak,
Not really. I have a dataset which i fetch in power bi from the database and I use it as input for my python script. The script performs calculations (lets say for simplifying Input 1 * Input 2) when model= x , Input1 + Input 2 when model=y etc.. and the user shoudl be able to select one model at a time with a slicer...Country and and Type also are slicers and filters for teh inputdataframe. The poblemis that the script return a second table with different output and i can't create relationships in modeling eg with country,model etc. Thus I need to give these parameters already in my input dataset.
COUNTRY | TYPE | MODEL | INPUT 1 | INPUT 2 |
A | 1 | X | 10 | 1 |
B | 2 | Y | 20 | 2 |
C | 3 | Z | 30 | 3 |
D | 4 | W | 40 | 4 |
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |