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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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