Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 red
if cell value = 4 highlight it with blue
I tried to apply the following
But it did not work
I applied this formula to create a new column
Table.AddColumn(#"Unpivotted","test", each if [P08 Evaluation] ="Attention to Cost" then "#198c19" else "#a500ff")
Then I formatted my column based on this newly created column
here is the error I am getting,
Solved! Go to Solution.
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 _color
Attaching the pbix file for your reference.
@abukapsoun , if you have given column in a field value, It might have asked for Aggregation, Make sure it should be Min or Max
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 _color
Attaching the pbix file for your reference.
Hi,
Thanks for your solution.
I am trying to use your solution but it is failed when I want to select the measure "color".
I am using one dataset for my visual. Is it the reason?
It is not allowed me to select it.
It 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!
I 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?
ive done it.
thanks
i was missing the # !!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |