Forum Discussion
abukapsoun
Post Patron
6 years agohighlight cell value based on color
Hi I have a table as visual in powerBI. i would like to apply some colors if a cell value in a certain column equals to something. for example if cell value = 2 then highglihgt the cell with re...
- 6 years ago
You have to create a measure and use that measure in the field format option.
Example:
DAX measure
Color = var _cellvalue= SELECTEDVALUE('Table'[LastTransaction]) var _color= IF(_cellvalue="No","#198c19","#a500ff") return _colorAttaching the pbix file for your reference.
abukapsoun
Post Patron
6 years agoIt worked like charm!! Thanks you very very very much.
And last thing, is it possible to have a button or a slicer dropdown (yes & no) in the report, if yes is selected, this conditional formatting will be applied, and if no, then nothing?
Thanks again!
abukapsoun
Post Patron
6 years agoI was thinking if we can create a column with yes and no value. and then extend the IF formula, by saying if colum1 = no then color would be white. and if value = yes then we apply another if to evaluate which color to display. How can we do that with formula?
- abukapsoun6 years ago
Post Patron
ive done it.
thanks
- abukapsoun6 years ago
Post Patron
Color =var _cellvalue = SELECTEDVALUE(Pivotted[P08 Evaluation])var _yesno = SELECTEDVALUE(YesNo[Evaluate])var _color = IF(_yesno="No","f00000",IF(_cellvalue="Attention to Cost","#ff0000",IF(_cellvalue="Attention to Sales","#ff0000")))return _colorI have a dropdown slicer with the "evaluate" column. When Yes is selected the color ff000000 appears,When I select No the same below error appears, "we found a value we dont recognize for background"Thanks,- abukapsoun6 years ago
Post Patron
i was missing the # !!