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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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