Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hello. I have created a boxplot (box and whisker) chart using Jan Pieter Posthumas visual. Here is a snapshot of what it looks like:
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:
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!
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
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:
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
79 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
59 | |
59 | |
49 | |
42 |