Forum Discussion
Conditional Formatting Quirks
Hi,
I have data for forecast and budget. The former is a measure which calculates forecast headcount based not only on whether they are established already but also adds in if they are due to join before a certain date (set by a slider).
I then have the variance as another measure (taking forecast minus budget). All three are displayed in a table like so:
| Forecast | Budget | Variance |
| 180 | 190 | -10 |
I want to have conditional formatting on the table such that when the variance goes between certain values it turns different colours (e.g. -5 to +5 people formatted as green, -10 to -6 as amber, anything absolutely greater than -10 is red).
However when I try to use conditional formatting on PowerBI and input these values in the 'rules' tab, no conditional formatting takes place and it is left without a background colour.
How do I get this to work please?
12 Replies
- amitchandakSuper User
You can create a measure that returns color and have to use it for each column of matrix
color measure = if([variance] <10,"red","green")
And then go to conditional formatting /background color, choose a color and hover on the color, you will see tree dot and option for conditional formatting. Use field option and this measure
Refer
https://medium.com/@raghu.949/conditional-formatting-of-matrix-visual-in-power-bi-9d37dd70c52e
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin - MFelixSuper User
Hi tobiasmcbride ,
I have tried and was abble to setup the visualization be sure that you have place the option to number (by default appears percent) and that you are placing the max and minimun on the correct place.
If you are using a matrix be aware that the condittional formatting doesn't work on total values so if you do not have any row values it considers it's a total line and doesn't returns any formatting.
- tobiasmcbrideHelper III
Hi,
I don't see the 'number' or 'percentage' icons for this measure. This is a measure I am using and I am using a table not a matrix.
- MFelixSuper User