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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AT12654__uld
Regular Visitor

Need help applying fixed color codes to dimensions across multiple tables in Power BI

Hi everyone,

I need to apply a fixed set of color codes to different dimensions in my data. Here’s my scenario:

  • I’m using stacked 100% and normal stacked charts.

  • My dimensions and measures are in the same table.

  • I have five such tables, and there are two common dimension fields across all of them.

  • Because of data granularity differences, I can’t create cross-table relationships, as some KPIs stop working when I do.

I want to define consistent colors for these two common fields so that they remain the same across all charts and tables. Currently, I have to manually assign colors in each visual, which isn’t scalable — especially since the number of categories can vary (sometimes 3, other times up to 15).

Screenshot 2025-11-05 164118.pngScreenshot 2025-11-05 204721.png

Is there a better or smarter way to manage this so that the colors stay consistent automatically across visuals?

Thanks in advance for your help!

2 ACCEPTED SOLUTIONS
Praful_Potphode
Impactful Individual
Impactful Individual

Hi @AT12654__uld 

Stacked charts don’t support dynamic color per data point inside a single stack.

Options you can try is:

  • Change colors manually for each visual.
  • Change colors in theme file
  • Save the report as power bi project(.pbip) and try to change colors in visual json file

Please give Kudos or mark it as solution once confirmed.

 

Thanks and regards,

Praful

 

 

View solution in original post

Hi @AT12654__uld ,
 
You can refer to the below Microsoft documentation to learn more about using custom themes in Power BI.
It explains how to define a set of default colors and apply them consistently across all visuals in a report.

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes

Best Regards, 
Community Support Team  

View solution in original post

7 REPLIES 7
AT12654__uld
Regular Visitor

Thanks everyone for your contributions. I will go ahead and define a template with all the color code, is there a way where I can assign fixed color to the categories. for ex: I define all the Color codes for the cities, so whenever the user uses the template and plot cities then the color code should be automatically assigned. same for other dimensions also like product name, category etc.

 

If there is already a thread / post that can be refered to, please share so that I can replicate the same

Hi @AT12654__uld ,
 
You can refer to the below Microsoft documentation to learn more about using custom themes in Power BI.
It explains how to define a set of default colors and apply them consistently across all visuals in a report.

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes

Best Regards, 
Community Support Team  

Praful_Potphode
Impactful Individual
Impactful Individual

Hi @AT12654__uld 

Stacked charts don’t support dynamic color per data point inside a single stack.

Options you can try is:

  • Change colors manually for each visual.
  • Change colors in theme file
  • Save the report as power bi project(.pbip) and try to change colors in visual json file

Please give Kudos or mark it as solution once confirmed.

 

Thanks and regards,

Praful

 

 

Hi @AT12654__uld ,
Thanks for reaching out to the Microsoft fabric community forum. 

 

I would also take a moment to thank  @Praful_Potphode  , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

 

 

Best Regards, 
Community Support Team  

Hi @AT12654__uld ,

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

 

 

Best Regards, 
Community Support Team  

wardy912
Solution Sage
Solution Sage

Hi @AT12654__uld 

 

 You should write a measure that defines colours for your dimensions.

 

Add a measure as follows:

 

CategoryColor =
SWITCH(
    SELECTEDVALUE('YourTable'[Category]),
    "Category A", "#4472C4",
    "Category B", "#ED7D31",
    "Category C", "#A5A5A5",
    "#000000" // default
)

 

I have some dummy data to represent funds, I've written the measure below:

 

CategoryColor = 
SWITCH(
    SELECTEDVALUE('dummy_fund_data'[Fund Name]),
    "Alpha Fund", "#4472C4",
    "Beta Fund", "#ED7D31",
    "Delta Fund", "#A5A5A5",
    "Gamma Fund", "#FFBF00",
    "#000000" // default
)

 

In the visuals, I then need to add this measure as conditional formatting

 

wardy912_0-1762378666320.png

 

wardy912_2-1762378732346.png

 

wardy912_3-1762378764887.png

 

This measure can be used on all visuals required.

 

--------------------------------

I hope this helps, please give kudos and mark as solved if it does!

 

Connect with me on LinkedIn.

Subscribe to my YouTube channel for Fabric/Power Platform related content!

 

Hi @wardy912 : I have tried to add the conditional formatting using the measure that you have recommended above but i do not get any option to apply the conditonal formatting. 

here is what I have used in the 100% stacked column chart. 

 

 

AT12654__uld_0-1762382300411.png

AT12654__uld_1-1762382411455.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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