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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cip
Frequent Visitor

Passing selected value of slicer to Python script?

I have a table with data extracted from an API using python script. The data can be filtered by different arguments in the script and I would like to create a slicer to allow users to select values between A and B of which the selection should be passed to the script as arguments and update the data table and the linked visuals (bar chart). Is that possible? I tried PowerBI parameter / using get_data, there is always a loading circle that will pop up for a brief second but the visual (and I doubt the dataset as well) is not updated.

 

Any help would be much appreciated, thanks!  

2 REPLIES 2
amitchandak
Super User
Super User

@cip , if you are using it visual and added that to visual; it should filter.

 

But if you are using python to load data it will not filter data based on slicer.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you so much for the reply!

Sorry I didn't make myself clear - I should say I'm trying to get certain subset of data from a dataset via API by using different arguments, and in this case I would like to set a slicer for users to select one string (A or B), then pass this string as argument to the script to pull the corresponding data.

 

Similar to this:

df = xxx.get(
    properties="A",
)

 Then the dataframe should only contain data with properities that match A.

 

Or would it be easier to use pandas to create the graph and import it as python visual in PowerBI?

 

Thanks again!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.