Forum Discussion
Conditional Formatting on a per value basis in table
- Anonymous5 years ago
You can achieve this by different simple options.
Option A:
Apply the conditional format by rules as you mention it. Since data will be on a table, aggreation won't matter because data will be at a row level thus you will have the cell value. That's the easiest one.
Option B:
Go to Power Query and add a conditional column where" if column with x value is greather than 0 then:" you add the HEX code for red (#FF0000) else white (#FFFFFF).
Then, apply conditional format by field value and select the column with the HEX codes.
Option C:
Create a DAX measure with the following structure:
MeasureForFormat =
var cell_value = SELECTEDVALUE([ColumnWhereYourNumberIs])
Return
IF(cell_value > 0, "#FF0000", "#FFFFFF")
Then, apply conditional formmating by field value and use this measure as field value.
I hope this helps 🙂
Having that column as string type complicates it a little bit more. If it's possible for you, send me a sample or your .pbix file and I can help you 🙂
It looks like Option B did the trick after a refresh. The string type ended up being find so long as you say in your if statement the value ="0" instead of 0. If anyone else is having trouble it does see the aggregation type (at least for field value conditional formatting) doesn't really have an effect. If you see if mishighlighting, just try to refresh your application.