Forum Discussion
Color Coding Issue
- 20 days ago
Hi umeshgupta052,
One approach that works well is to avoid manually assigning colors to every brand. Instead, create a dedicated Brand Color mapping table and use it across the report.
For brands that need specific corporate colors, store them in the mapping table. For all other brands, use a DAX measure so new brands automatically receive a consistent color without manual maintenance.
Brand Color =
VAR CustomColor = LOOKUPVALUE( BrandColors[Color], BrandColors[Brand], SELECTEDVALUE(Sales[Brand]) )
RETURN IF( NOT ISBLANK(CustomColor), CustomColor, "#" & RIGHT( FORMAT( ABS(HASH(SELECTEDVALUE(Sales[Brand]))), "X" ), 6 ) )
Then use this measure in Conditional Formatting > Data Colors > Format by Field Value.
For enterprise-scale reports, I would recommend maintaining a Brand Dimension table with a Color column and using that as the single source of truth for color mapping throughout the report. This is usually much easier to manage and govern than setting colors individually in each visual.
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Thank you.