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 would like to inquire whether have you got the chance to check the solutions provided by other users in community to resolve the issue. We hope the information provided helps to clear the query. Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.