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
rveerasamy
Helper III
Helper III

Tree Map - Need a treemap showing data colors as Green or Red

Hi

 

We have been provided a treemap sample (Refer Image 1).

 

However the tree map visual is Power BI as far as I know does not support condition based Data colors that would display negative values to be shown in shades of red and positive values to be shown in shades of green. We should also be able to show a similar legend as in image 1.

 

Does anyone know if there is an appropriate visual in power bi to get simmilar results.

 

Thanks for your help

Matthew

 

TreeMap 1.PNG

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@rveerasamy  ok. i was looking into your problem then came up with interesting solution. 

 

As you know, powerbi treemap can only represent positive value as it shows the shape size basis the value. bigger the value, bigger the size. 

 

1. let's assume your data is similar to below table. First two columns are data and last two columns are calculated values

we can have only positive values to show the correct map

change% new = ABS('Table'[Change%]) 

this will be used to conditional format positive and negative actual values
color_coding = if ('Table'[Change%]<0,"Red","green") 

 

negi007_0-1635499256392.png

 

2. below is how you put values in your visual

 

negi007_1-1635499442526.png

 

i have attached the pbix file as well here. this will help you and others who are looking for similar solution. 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

2 REPLIES 2
rveerasamy
Helper III
Helper III

negi007, We will try your solution and get back to you

negi007
Community Champion
Community Champion

@rveerasamy  ok. i was looking into your problem then came up with interesting solution. 

 

As you know, powerbi treemap can only represent positive value as it shows the shape size basis the value. bigger the value, bigger the size. 

 

1. let's assume your data is similar to below table. First two columns are data and last two columns are calculated values

we can have only positive values to show the correct map

change% new = ABS('Table'[Change%]) 

this will be used to conditional format positive and negative actual values
color_coding = if ('Table'[Change%]<0,"Red","green") 

 

negi007_0-1635499256392.png

 

2. below is how you put values in your visual

 

negi007_1-1635499442526.png

 

i have attached the pbix file as well here. this will help you and others who are looking for similar solution. 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.