Forum Discussion
Icons Conditional Formatting by Field
- 7 years ago
Hello PaulBI
Are you having trouble getting the incon names to use? Anonymous put together a list in one of his posts from another source you could take a look at.
https://community.powerbi.com/t5/Desktop/What-are-the-icon-IDs-In-July-update/m-p/752075#M362440
In this example, I wrote a measure to read the value of my measure then a switch to set the icon.
Format Notes = VAR TheTest = SUM (Notes[Notes] ) / 100 RETURN SWITCH ( TRUE(), TheTest < .2, "CircleEmpty", TheTest < .4, "Circle25", TheTest < .6, "CircleHalf", TheTest < .8, "Circle75", "CircleFilled" )Then I use conditional formatting > Icons on the measure I am trying to highlight and pick 'Fileld Value', and use my formatting switch measure from above.
Hello PaulBI
Are you having trouble getting the incon names to use? Anonymous put together a list in one of his posts from another source you could take a look at.
https://community.powerbi.com/t5/Desktop/What-are-the-icon-IDs-In-July-update/m-p/752075#M362440
In this example, I wrote a measure to read the value of my measure then a switch to set the icon.
Format Notes =
VAR TheTest = SUM (Notes[Notes] ) / 100
RETURN
SWITCH (
TRUE(),
TheTest < .2, "CircleEmpty",
TheTest < .4, "Circle25",
TheTest < .6, "CircleHalf",
TheTest < .8, "Circle75",
"CircleFilled"
)
Then I use conditional formatting > Icons on the measure I am trying to highlight and pick 'Fileld Value', and use my formatting switch measure from above.
Thank you, this is extremely helpful.
I am trying to create a similar code to populate cells with an Icon, however I am unable to use UNICHAR() to create an Icon as shown below.
- jdbuchanan716 years agoSuper User
Hello Earosenfeld
I was able to use the UNICHAR function wtih no problem. Here is the sample measure I tested.
Formatting = VAR Mtl_Sub = SELECTEDVALUE(ENG_DATA[Subject]) VAR Mtl_Val = SELECTEDVALUE(ENG_DATA[Value]) VAR _ThumbsUp = UNICHAR ( 128077 ) VAR _Smiley = UNICHAR ( 128578 ) VAR _Frown = UNICHAR ( 128577 ) VAR _Neutral = UNICHAR ( 128528 ) RETURN SWITCH( TRUE(), Mtl_Sub = "MtlAdded" && Mtl_Val = "1",_ThumbsUp, Mtl_Sub = "MtlAdded" && Mtl_Val = "2",_Smiley, Mtl_Sub = "MtlAdded" && Mtl_Val = "3",_Frown, "No Match" )And it works if it is in a VAR or not.
RETURN SWITCH( TRUE(), Mtl_Sub = "MtlAdded" && Mtl_Val = "1",UNICHAR ( 128077 ), Mtl_Sub = "MtlAdded" && Mtl_Val = "2",_Smiley, Mtl_Sub = "MtlAdded" && Mtl_Val = "3",_Frown, "No Match" )Does this help at all?
- Earosenfeld6 years agoAdvocate II
Thank you
- Anonymous5 years agoNot applicable
Hi, how did you keep field "No Match" when I do conditional formatting, I can choose either only icons or text next to icon, i used the same formula as you and the text " No match" doesn't show