- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Colors in bar charts with hierarchy
Good morning everyone,
I'm trying to assign automatically a color to each region (see below), without having to select it manually under the visual options.
Also, in the bar chart there's a drill down to country level, and I'm wondering wether it could be possible to maintain the Region colors when I get to the country view:
The process of assigning colors should be automatic since the number of Regions is not static, and each Region might be split into two in the future.
Thanks for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hey @Alex-PBIComm ,
this is not possible as Power BI does not support a dynamic assignment of colors to column values.
You can achieve something that comes close to this, if store the color you want to use for a region/country inside the table and use conditional formatting to apply the colors accordingly, but this can become tedious.
The solution works something like this:
- Create a measure that checks if region/country has a single value, if yes look for the color stored
- Use the measure to control the background color or a similar aesthetic property like line color inside the conditional formatting
Hopefully, this provides you with some ideas to tackle your challenge.
Regards,
Tom
Did I answer your question? Mark my post as a solution, this will help others!
Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

You might want to take a look at this.
https://radacad.com/set-power-bi-data-color-all-visuals-to-follow-same-color-for-the-same-data-point
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hey @Alex-PBIComm ,
this is not possible as Power BI does not support a dynamic assignment of colors to column values.
You can achieve something that comes close to this, if store the color you want to use for a region/country inside the table and use conditional formatting to apply the colors accordingly, but this can become tedious.
The solution works something like this:
- Create a measure that checks if region/country has a single value, if yes look for the color stored
- Use the measure to control the background color or a similar aesthetic property like line color inside the conditional formatting
Hopefully, this provides you with some ideas to tackle your challenge.
Regards,
Tom
Did I answer your question? Mark my post as a solution, this will help others!
Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
Anonymous
| 05-11-2022 01:58 PM | ||
09-25-2024 01:56 PM | |||
05-31-2024 01:54 AM | |||
09-13-2024 10:37 AM | |||
Anonymous
| 01-02-2023 04:22 AM |