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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
vipett
Helper II
Helper II

Colors changed in report unexpectedly

I have a report with two stacked bar charts and in total it is about ~50 companies.

In one slicer I choose a region and this narrows it down to between 1-5 companies.

In my report I have a theme with the company colors and yesterday when I saved the report, the first company based on the selected region got the primary color, the second company got the secondary color, etc, etc

But today when I opened up the report, if I chose the first region, which only has one company, that company gets  the primary color, when I switch to the second region, those companies gets the 2nd, 3rd, 4th, 5th and 6th color as per the theme.

When I continue with the later categories, the colors are really wierd and not colors designated in the theme.

 

Has anyone else experienced this?

I would like to have it like in the past, where the first country in each selected region gets the primary color, 2nd gets the secondary, etc.

 

2 ACCEPTED SOLUTIONS
Jai-Rathinavel
Super User
Super User

@vipett  Yes, I have faced this issue, the colors were jumbled between the report in desktop view and the report in service. I tried setting it manually couple of times but it didn't help. Instead of setting the colors manually in the bar chart I resorted to using Conditional Formatting using a measure.

The measure forces the visuals to use the assigned colors and It is also easy to change the colors of the categories in future without having to revisit all the visuals.

Create a measure like below and add it your fx option under your visuals

Color Format = SWITCH(Products[Category], 
                      "Mobile", "#89010A",
                      "Laptop", "#ffffff", 
                      "#55f443")

 

Thanks,

Jai




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Ritaf1983
Super User
Super User

Hi @vipett 

This issue with colors "jumping" or appearing inconsistently is a known limitation in Power BI.
If you're not using a legend to assign colors (based on a dimension like company), Power BI doesn’t lock the color positions reliably – especially in stacked charts.

If you're coloring by a measure or category directly on the bar, one workaround is to use conditional formatting to explicitly set the colors.
Unfortunately, if the color logic is driven only by the stacked segments without a legend, there's no native way to ensure stable color assignment.

If you're able to share a simplified version of your PBIX file and a description of the desired outcome, I’d be happy to think of an alternative visual solution.
In many cases, stacked bar charts are not ideal for reading exact values or comparing across groups – especially when showing absolute values. They can even be misleading depending on how the data is laid out.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

9 REPLIES 9
v-veshwara-msft
Community Support
Community Support

Hi @vipett ,

Since we haven't heard back from you after our last reply, we wanted to follow up and check if the manual color approach was helpful and sustainable for your scenario. Also, if you found any of the replies in this thread useful, please consider marking them as Accepted Solution, as this helps others with similar queries find the answers more quickly.

Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @vipett ,

Thanks for posting this in Microsoft Fabric Community.

Based on your description, it does sound like the report was initially honoring the theme color sequence correctly per slicer selection, but the behavior has recently changed.

 

As @Ritaf1983  mentioned, Power BI does not always preserve consistent color mapping in visuals like stacked bar charts, especially when a legend isn't used. The auto-assigned theme colors may shift based on the number and order of visible categories, which explains the inconsistent coloring you're now seeing when switching between regions.

 

@Jai-Rathinavel ’s suggestion to use conditional formatting with a measure is a good way to enforce consistent color behavior across all slicer selections. This avoids relying on Power BI’s default color assignment, which can change between sessions or visual states.

If this change occurred suddenly, it's worth checking whether any of the following happened recently:

  1. A change to the report theme or re-application of it

  2. Edits to the company field or sorting logic

Hope this helps. Please reach out for further assistance.

Please consider marking the helpful reply as Accepted Solution to assist others with similar issues. A kudos would also be greatly appreciated.

Hi again, 

 

I did some testing, if I remove my measure I see the list of all companies in that region with their respective color to the left.

When I add my measure, only the companies with 1,2,3 have values, so they retain their colors from the order (see second picture).

 

Is there a way to "reset" the assignment of colors based on which ones have values?

The measure is

MyMeasure= IF([Measure 1]/1000=0,BLANK(),[Measure 1]/1000) and I have a filter to say only show MyMeasure when the value is not blank.

 

vipett_0-1747646963732.png

vipett_1-1747647061783.png

 

Hi @vipett ,

Thanks for the detailed follow-up and testing.

Since you're using Company Name in the legend, the inconsistent color assignment might be due to a known Power BI limitation - colors can shift when some categories return BLANK(), as Power BI still includes them in the legend and color mapping.

 

As you noticed, even if a company has no values, Power BI still reserves a color for it. So the companies with visible values start picking up colors further down the theme sequence. Switching from Company Name to Company ID changes the internal order temporarily, which is why the colors may appear correct in some selections but not consistently across all regions.

 

To answer your question - there’s no built-in way to reset color assignments based only on non-blank values. Power BI doesn’t dynamically exclude legend entries based on whether the measure returns a value.

 

The most reliable workaround is to use conditional formatting via a measure, as suggested earlier. This ensures each company gets a consistent color regardless of slicer selections or data visibility.

 

Hope this helps. Please reach out for further assistance.

Please consider marking the helpful reply as Accepted Solution and giving kudos to assist others with similar issues.

Thanks, I resorted to manual colors for now, let's see if that is sustainable!

Glad to hear you've found a workable approach for now! If you ever decide to switch to a more dynamic setup, conditional formatting remains a good option to ensure consistent colors across slicer selections.

Also, if any of the replies above were helpful, please consider marking one as the Accepted Solution - it helps others in the community find answers more easily.

 

Best Regards,
Vinay.

Hi,

 

I use a legend, "company Name", I have not done any changes to the company field, sorting or anything.

If I have selected Region X and the colors are wrong, and then change the 'company name' in the legend to 'company ID', then the colors are correct for that visual, but when I change to Region Y or W, then the colors are wrong for those companies.

 

I understand that not all colors will be used, depending on number of companies in each region, but it seems it is applying color 1 to company 1 (which may not have any values), and then it becomes color 10 for the first company with values. This however does not explain why it becomes correct when I change from Company Name to Company ID..

Ritaf1983
Super User
Super User

Hi @vipett 

This issue with colors "jumping" or appearing inconsistently is a known limitation in Power BI.
If you're not using a legend to assign colors (based on a dimension like company), Power BI doesn’t lock the color positions reliably – especially in stacked charts.

If you're coloring by a measure or category directly on the bar, one workaround is to use conditional formatting to explicitly set the colors.
Unfortunately, if the color logic is driven only by the stacked segments without a legend, there's no native way to ensure stable color assignment.

If you're able to share a simplified version of your PBIX file and a description of the desired outcome, I’d be happy to think of an alternative visual solution.
In many cases, stacked bar charts are not ideal for reading exact values or comparing across groups – especially when showing absolute values. They can even be misleading depending on how the data is laid out.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Jai-Rathinavel
Super User
Super User

@vipett  Yes, I have faced this issue, the colors were jumbled between the report in desktop view and the report in service. I tried setting it manually couple of times but it didn't help. Instead of setting the colors manually in the bar chart I resorted to using Conditional Formatting using a measure.

The measure forces the visuals to use the assigned colors and It is also easy to change the colors of the categories in future without having to revisit all the visuals.

Create a measure like below and add it your fx option under your visuals

Color Format = SWITCH(Products[Category], 
                      "Mobile", "#89010A",
                      "Laptop", "#ffffff", 
                      "#55f443")

 

Thanks,

Jai




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors