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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

Top Solution Authors