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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I need conditional formatting on my Treemap based on a different cells values.
For example here is my treemap:
Here is a snapshot of my data:
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.
Solved! Go to Solution.
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
the 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:
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.
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
the 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:
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.
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.
@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://www.tutorialgateway.org/heat-map-in-power-bi/