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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
powertron
New Member

Showing Consistent Colors on a Graph Legend

Hi,

 

I have a bar graph which is showing values from a table, this graph has a date range which can be lowered/increased to show information over different timeframes.  Standard stuff so far.

When selecting data over "all time" there are 4 values represented on this graph : 

powertron_0-1678185354080.png

However when lowering the date range some ranges do not have all 4 values, so the legend/color scheme is changing : 

powertron_1-1678185765532.png

Is there a way to have a consistent "Light Blue = Completed" "Dark Blue = Not Started".... type value set anywhere so the graph has consistent colors no matter the values presented on it?

 

 

7 REPLIES 7
LaurenceSD
Advocate II
Advocate II

Hi,

 

I experienced this as well & found the fix was to select Show items with no data

 

LaurenceSD_0-1678191528779.png

 

This way when one field drops off due to having no data the colours will remain the same as it'll still be there in the legend bar

Hi,

 

I've tried this (assume I should be selecting this on the "Legend" value?) : 

powertron_0-1678193348247.png

However the issue is the same.  If I select a date range where only 2 of the values are selected it shows one color scheme : 

powertron_1-1678193396391.png

And this is not consistent when there are more values: 

powertron_2-1678193425660.png

Is your legend data coming from a Fact or Dimension table? I'm guessing it's the former, if you put the legend data into a Dimension data and then create a 1 to many relationship, then the method mentioned above should work

MAwwad
Super User
Super User

Yes, you can manually set the colors for each category in the legend of your Power BI bar graph. Here's how to do it:

  1. Click on the bar graph visualization to select it.
  2. In the Visualizations pane, click on the Format tab.
  3. Expand the "Data colors" section.
  4. By default, the colors will be set to "Automatic". To set your own colors, click on "Custom colors".
  5. In the "Custom colors" section, click on the dropdown arrow next to the category you want to set a color for.
  6. Choose "Specific color" and select the color you want to use for that category.
  7. Repeat this process for each category in the legend.

Once you have set the colors for each category, they will remain consistent regardless of the data being displayed.

Note: If you add new categories to your data, you will need to manually set the colors for those categories as well.

I have stacked car chart with only top 7 selection. I know how to change the colors, but that is only for the initial selection. When I change slicer, I get different colors. How do I keep the colors consistent?

Hi,

 

Clicking on the Graph and selecting the "Visualisation" option does not show a "Data Colors" option that I can see : 

powertron_0-1678188428166.pngpowertron_1-1678188445034.png

 

I've opened every sub menu and can't see anywhere to set Data Colors.

 

 

 

Hi,

 

The "Columns" data does have a "Colors" option but nothing to suggest I can turn on/turn off auto selection : 

powertron_2-1678188622754.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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