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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I am looking to assign specific colors to specific values in the JSON theme. Is this possible?
For example, if the Company Name is "Facebook" use "#235eb5", if the Company Name is "Honda" use "#dd0f31", etc. (Hex codes not correct).
The only way I have found to do this is to go into each visualizations formatting and manually set the conditional formatting. I would like the theme to detect the values and assign the colors.
Solved! Go to Solution.
Hi @Todd88 ,
No, the Power BI theme JSON file does not currently support assigning colours to specific dimension values (e.g. "Facebook" = blue, "Honda" = red) automatically. Themes can define colour palettes and default formatting, but value-based conditional formatting must be configured manually or via rules inside visuals.
| #235eb5 | |
| Honda | #dd0f31 |
✅ If this response resolved your issue, please mark it as correct to help other members of the community.
Hi @Todd88,
I would like to let you know that unfortunately Power BI themes (defined in a theme.json file) cannot dynamically assign colors to specific categorical values(Ex: Facebook, Honda and etc)
Power BI themes can only do global color palettes (data colors, backgrounds, text), specific visualization style default, global font sizes, gridlines, etc.
But there is a workaround, by using below meassure you can achieve you requirement. Then, in each visual use this measure for conditional formatting on the data color. You can reuse this measure across all visuals.
CompanyColor =
SWITCH(
SELECTEDVALUE('Company'[Company Name]),
"Facebook", "#235eb5",
"Honda", "#dd0f31",
"Google", "#4285F4",
"Apple", "#A2AAAD",
"#808080" // default color
)
Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.
Hi @Todd88 ,
No, the Power BI theme JSON file does not currently support assigning colours to specific dimension values (e.g. "Facebook" = blue, "Honda" = red) automatically. Themes can define colour palettes and default formatting, but value-based conditional formatting must be configured manually or via rules inside visuals.
| #235eb5 | |
| Honda | #dd0f31 |
✅ If this response resolved your issue, please mark it as correct to help other members of the community.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 31 | |
| 21 | |
| 19 |
| User | Count |
|---|---|
| 138 | |
| 102 | |
| 59 | |
| 36 | |
| 35 |