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.
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.
The issue is brand changes with category like food nutrition so i want a scalable solution where i can color code brand with category and creating a static table means if in future new brand vome in it wont be taken care of