Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
EricH77
Frequent Visitor

PBI Tree Map Color Mapping

I have created a tree map in PBI and the layout looks exactly how I need it to look but the visual colors are not what I need.  I need to only use a color scheme consisting of Red, Yellow, Green, and Gray based on the corresponding Health Indictor field which uses the text Red, Yellow, Green, and Gray.  To achieve this, I need PBI to base the colors on the details field (Health Indictor).  However, it appears that be defualt it is selecting the category field (Client Code).  I can't swap the inputs to these fields because it completely changes the layout.  Is there anyway to change what field PBI uses for the visual color scheme?

 

Screenshot Treemap.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@EricH77 , if you have details, you will not be able to use conditional formatting. If you are looking for that. Move both columns to Category and the create a color measure and use that in color using Fx option

 

example

 

Measure =
Switch(true(),
max(Table[Column]) = "R1" , "Red" ,
max(Table[Column]) = "R2" , "Green" ,
max(Table[Column]) = "R3" , "Pink "
)

 

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
_AAndrade
Super User
Super User

Hi,

I think it's not possible to do as you want, but you can probably work around it doing this:
Classify your clients by Health Indicator and after create a measure to select the color you want by health indicator and put this measure on "Colors"-->Advanced controls





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




amitchandak
Super User
Super User

@EricH77 , if you have details, you will not be able to use conditional formatting. If you are looking for that. Move both columns to Category and the create a color measure and use that in color using Fx option

 

example

 

Measure =
Switch(true(),
max(Table[Column]) = "R1" , "Red" ,
max(Table[Column]) = "R2" , "Green" ,
max(Table[Column]) = "R3" , "Pink "
)

 

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors