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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors