Forum Discussion
Power BI Treemap Conditional Formatting
- 6 years ago
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:
- https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting
- https://community.powerbi.com/t5/Desktop/Conditional-Formatting-of-Bar-Chart/td-p/594009
- 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.
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.