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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors