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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
8shipsbynight
Helper I
Helper I

Box Plot color consistency

Hello. I have created a boxplot (box and whisker) chart using Jan Pieter Posthumas visual. Here is a snapshot of what it looks like:

 

bCapture.JPG

 

As you can see, I have 3 boxplots (W,U,L) with 3 consistent colors. The problem I have is that the colors do not remain consistent when items are filtered out. Based on some filters I have chosen, "U" no longer has data, so the boxplot does not show and then the colors for "W" and "L" change - see below:

b2Capture.JPG

 

How can I keep the colors consistent? Or is there a way to keep the 3 boxplots in the report regardless of the filters chosen?

 

Thanks!

4 REPLIES 4
MartynRamsden
Solution Sage
Solution Sage

Hi @8shipsbynight 

 

You can set specific colours for each category under the 'Data colors' section of the Format pane.

Make sure the 'Show all' switch is on and then you'll see each category and a colour selector listed below.

 

Best regards,

Martyn

 

Capture.JPG

 

 

 

 

 

Hi @MartynRamsden  I appreciate the suggestion, but the problem I am having is that when I filter down the data based on several different criteria, the population size decreases. This means that sometimes "W" has no records to build a boxplot and then my colors shift or don't stay the same. Here is a screenshot of the "Data Colors" area and as you can see "W" can not be found:

 

filter.JPG

Hi @8shipsbynight 

 

I've done some testing and now fully understand your issue. Unfortunately, I don't think there's a solution.


I was under the impression that when using the 'Data colours' formatting option, you were assigning colours directly to categories - it appears this isn't the case in this visual!
It looks like the colours are actually being assigned to the order the categories appear in. Hence, if a category is filtered out, the remaining visible categories will change colour, as you're seeing.

 

Most of the built in Power BI visuals now support Conditional Formatting but this isn't an option in the Box Plot visual you're using.


Sorry I can't be of any more help!

 

Best regards,

Martyn

Thanks @MartynRamsden  - you are spot on. The colors are based upon sorting, unfortunately. At this moment I do not know a better way to color the boxplots. Oh well! I'll keep trying.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.