Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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).
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!
Solved! Go to Solution.
Stacked charts don’t support dynamic color per data point inside a single stack.
Options you can try is:
Please give Kudos or mark it as solution once confirmed.
Thanks and regards,
Praful
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
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
Stacked charts don’t support dynamic color per data point inside a single stack.
Options you can try is:
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
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
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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!