Forum Discussion
Consistent color mapping across visuals in Power BI reports
Hi All,
I am working on standardizing report design across multiple Power BI reports and ran into a limitation with color management.
Currently, when using conditional formatting or color by field value, the color settings must be configured separately for each visual. There is no global setting that ensures the same category always uses the same color across all visuals in the report.
For example, if a category like Product A is blue in one chart, it might appear as a different color in another visual unless we manually configure it.
This makes report standardization and governance difficult, especially for large reports with many visuals.
I tried Theme, but it mainly controls the overall layout and color palette. They don’t automatically assign specific colors to certain data categories like Product A - always blue color.
I am curious how you are solving this problem.
Thanks!
The standard solution for this is a color mapping table + DAX conditional formatting measure, and it scales well across large reports.
Step 1 — Create a color mapping table (either in Power Query or as a calculated table):
CategoryHexColorProduct A#4472C4Product B#ED7D31Product C#A9D18E
Step 2 — Create a DAX measure that looks up the color for the current context:
daxCategory Color =
LOOKUPVALUE(
ColorMapping[HexColor],
ColorMapping[Category],
SELECTEDVALUE('Products'[Category]),
"#BFBFBF" -- default fallback color
)
Step 3 — Apply to each visual via Format → Data colors → fx (conditional formatting) → Field value → select your Category Color measure.
Yes, you still have to wire it up per visual — there's no true global binding in Power BI today — but you only define the colors once in the mapping table. When you need to change Product A's color, you update one row and it flows everywhere automatically.
For cross-report consistency, the cleanest approach is to put the color mapping table in a shared semantic model that all reports connect to. Then every report uses the same source of truth.
Bonus tip: You can also embed the color mappings directly in the report theme JSON under dataColors with named entries, but that approach only works reliably for series order, not specific category-to-color bindings. The DAX measure method is more robust for named categories.1) Create a color mapping table
Create a small table that defines the color for each category.
2) Create a color measure
Return the color based on the current category.
Product Color = SELECTEDVALUE ( ProductColorMap[Color] )3) Apply conditional formatting
In each visual:
Format → Data colors → Conditional formatting → Format by: Field value
Select the Product Color measure.
7 Replies
- Juan-Power-bi
Super User
The standard solution for this is a color mapping table + DAX conditional formatting measure, and it scales well across large reports.
Step 1 — Create a color mapping table (either in Power Query or as a calculated table):
CategoryHexColorProduct A#4472C4Product B#ED7D31Product C#A9D18E
Step 2 — Create a DAX measure that looks up the color for the current context:
daxCategory Color =
LOOKUPVALUE(
ColorMapping[HexColor],
ColorMapping[Category],
SELECTEDVALUE('Products'[Category]),
"#BFBFBF" -- default fallback color
)
Step 3 — Apply to each visual via Format → Data colors → fx (conditional formatting) → Field value → select your Category Color measure.
Yes, you still have to wire it up per visual — there's no true global binding in Power BI today — but you only define the colors once in the mapping table. When you need to change Product A's color, you update one row and it flows everywhere automatically.
For cross-report consistency, the cleanest approach is to put the color mapping table in a shared semantic model that all reports connect to. Then every report uses the same source of truth.
Bonus tip: You can also embed the color mappings directly in the report theme JSON under dataColors with named entries, but that approach only works reliably for series order, not specific category-to-color bindings. The DAX measure method is more robust for named categories. - cengizhanarslan
Super User
1) Create a color mapping table
Create a small table that defines the color for each category.
2) Create a color measure
Return the color based on the current category.
Product Color = SELECTEDVALUE ( ProductColorMap[Color] )3) Apply conditional formatting
In each visual:
Format → Data colors → Conditional formatting → Format by: Field value
Select the Product Color measure.
- SinghArchanaFrequent Visitor
Thanks, this is a very helpful approach and I agree that a color mapping table plus DAX measure is a good workaround when the visual is based on a fixed category field.
However, in my case I am also using field parameters, and that is where this becomes difficult. When the dimension changes dynamically through the parameter, the color lookup measure does not always work correctly and I start getting errors or inconsistent behavior in conditional formatting.
So while the mapping table approach works for static dimensions, it does not seem to handle dynamic field parameter scenarios very well.
I am looking a reliable way to apply the same kind of category based color standardization when field parameters are used in visuals?
- AnonymousNot applicable
Hi SinghArchana ,
I would take a moment to thank cengizhanarslan , 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 wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions
- AnonymousNot applicable
Hi SinghArchana ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
- SinghArchanaFrequent Visitor
Hi Anonymous ,
Thank you for your reply.
I tried the suggested solution and it works well in standard scenarios. However, when using a field parameter in the Legend, I’m unable to see the fx (conditional formatting) option for data colors, so I cannot apply colors based on a measure.
Could you please confirm if conditional formatting is supported when a field parameter is used in the Legend, or if there is any recommended workaround for this scenario?
Thanks in advance!