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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Power BI Treemap Conditional Formatting

Hello,

 

I need conditional formatting on my Treemap based on a different cells values.

 

For example here is my treemap:

1.PNG

 

Here is a snapshot of my data:

2.PNG

 

What I want is conditional formatting for the colors of the boxes based on the Percentage column:

 

>.1 Dark Green

>0 Light Green

<0 Light Red

<.1 Dark Red

 

Is there anyway to do this?  Under my data color tab in the Treemap I do not see any options.

 

3.PNG

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

In the latest version of power bi desktop, I have tested that conditional formatting in data colors is not supported in most visuals except matrix, table... In most visuals, you can just set custom colors with color pane in Data color options.

If you insist on this, you can try earlier version of power bi desktop: https://docs.microsoft.com/en-us/power-bi/desktop-latest-update-archive#november-2018-update-2645285582

To set conditional format, you can create a measure like this:

Color_Control = 
IF (
    SELECTEDVALUE ( 'Table'[Percentage] ) > 0.1,
    "#047809",
    IF (
        SELECTEDVALUE ( 'Table'[Percentage] ) > 0,
        "#0dfc00",
        IF (
            SELECTEDVALUE ( 'Table'[Percentage] ) < 0,
            "#ff0000",
            IF ( SELECTEDVALUE ( 'Table'[Percentage] ) < 0.1, "#b00707" )
        )
    )
)

The following steps and result are under a table visual:

Conditional Formatting -> Advanced Control -> Format by value -> Based on field -> your previous measure

conditional format.png

the result in table visualthe result in table visual

If you find favorable desktop version, you can mimic the steps above, if not, perhaps you can submit the requirement to ideas and add your comments there to make this feature coming sooner: https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

For further information about conditional formatting, you can refer the following Microsoft document, case and blog that could help you:

  1. https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting
  2. https://community.powerbi.com/t5/Desktop/Conditional-Formatting-of-Bar-Chart/td-p/594009
  3. https://community.powerbi.com/t5/Community-Blog/Conditional-Formatting-in-Power-BI-Tables/ba-p/427990

 

Best Regards,

Yingjie Li

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

In the latest version of power bi desktop, I have tested that conditional formatting in data colors is not supported in most visuals except matrix, table... In most visuals, you can just set custom colors with color pane in Data color options.

If you insist on this, you can try earlier version of power bi desktop: https://docs.microsoft.com/en-us/power-bi/desktop-latest-update-archive#november-2018-update-2645285582

To set conditional format, you can create a measure like this:

Color_Control = 
IF (
    SELECTEDVALUE ( 'Table'[Percentage] ) > 0.1,
    "#047809",
    IF (
        SELECTEDVALUE ( 'Table'[Percentage] ) > 0,
        "#0dfc00",
        IF (
            SELECTEDVALUE ( 'Table'[Percentage] ) < 0,
            "#ff0000",
            IF ( SELECTEDVALUE ( 'Table'[Percentage] ) < 0.1, "#b00707" )
        )
    )
)

The following steps and result are under a table visual:

Conditional Formatting -> Advanced Control -> Format by value -> Based on field -> your previous measure

conditional format.png

the result in table visualthe result in table visual

If you find favorable desktop version, you can mimic the steps above, if not, perhaps you can submit the requirement to ideas and add your comments there to make this feature coming sooner: https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

For further information about conditional formatting, you can refer the following Microsoft document, case and blog that could help you:

  1. https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting
  2. https://community.powerbi.com/t5/Desktop/Conditional-Formatting-of-Bar-Chart/td-p/594009
  3. https://community.powerbi.com/t5/Community-Blog/Conditional-Formatting-in-Power-BI-Tables/ba-p/427990

 

Best Regards,

Yingjie Li

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

I'm currently using Power BI Desktop December version and inside the Data Colors options in the format tab, there is Option called Advanced Controls where you can define Conditional Formatting Rules. So maybe if you are using earlier version you may want to upgrade.

 

amitchandak
Super User
Super User

@Anonymous 

Conditional formatting is limited to the option provided. Even the option to use based on conditional formatting is not there.

In some case you can use matrix for that

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15900565-conditional-formatting-heat-map-functionality-in

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-november-feature-summary/#matrixConditionalFormatting

https://www.tutorialgateway.org/heat-map-in-power-bi/

 

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.