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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
bsz_29
New Member

How to use slicer partly on a python script based boxplot?

bsz_29_0-1667480385131.png

Figure 1. python implication of the problem

Hi, I want to make a visual on PBI based on the figure above. My dataset is like this:

 

bsz_29_1-1667480535267.png

Figure 2. dataset overview

 

So visual will show overall mean smape distribution among the data, but also a spesific 'series's mean smape value' that are selected via 'Series Slicer'.

To be more spesific, I want to choose one series from the slicer and want distribution to stay the same but highlight the point of the series' mean smape in the visual, just like in the first figure. 

My boxplot's python script code is below:

 

 

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script: 

# dataset = pandas.DataFrame(series, mean smape)
# dataset = dataset.drop_duplicates()

# Paste or type your script code here:
import seaborn as sns
import matplotlib.pyplot as plt
sns.boxplot(y=dataset['mean smape'])
plt.show()

 

 

 

I hope I manage to make the problem clear. Appreciate your help!

 

Best regards.

1 REPLY 1
lbendlin
Super User
Super User

When you apply  filters in your data model to the fields in your Python visual the visual will recalculate accordingly and re-plot.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.

Top Solution Authors