cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Icons Conditional Formatting by Field

I've been successfully conditional formatting Background and Font color by field for a while, but has anyone had any success in using the 'by field' conditional formatting for Icons?  It's an available option, but everytime I use it, it just removes any icons. 

 

The measure I had been using for background and Font were the typical "Red" and "Green" (and worked for background and font) but no luck using that same measure for the icons.

 

Any help would be greatly appreciated.

 

Thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Icons Conditional Formatting by Field

Hello @PaulBI 

Are you having trouble getting the incon names to use?  @AClerk 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"
    )

IconFormatSwitch.jpg

 

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.

IconFormatApplied.jpg

View solution in original post

7 REPLIES 7
Highlighted
Super User IV
Super User IV

Re: Icons Conditional Formatting by Field

Hello @PaulBI 

Are you having trouble getting the incon names to use?  @AClerk 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"
    )

IconFormatSwitch.jpg

 

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.

IconFormatApplied.jpg

View solution in original post

Highlighted
Frequent Visitor

Re: Icons Conditional Formatting by Field

That's exactly what I was looking for.  I was hoping there was a way to use one measure to set both icon and font at the same time, but a table of the icon names that I can set a second measure to works as well.

 

Thanks

Highlighted
Advocate I
Advocate I

Re: Icons Conditional Formatting by Field

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. 

IconCode =
VAR Mtl_Sub = SELECTEDVALUE(ENG_DATA[Subject])
VAR Mtl_Val = SELECTEDVALUE(ENG_DATA[Value])
Return
SWITCH(
TRUE(),
Mtl_Sub = "MtlAdded" && Mtl_Val = "1", UNICHAR(128077)
)
 
This code only will populate an Icon if I replace the UNICHAR function with the characters you used such as "CircleHalf". Is there a way to populate the Icons utilizing the UNICHAR function?

 

Highlighted
Super User IV
Super User IV

Re: Icons Conditional Formatting by Field

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"
)

Unichar.jpg

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?

 

 

Highlighted
Frequent Visitor

Re: Icons Conditional Formatting by Field - How to not display the text next to the comlumn

Hi

This was really helpful! I have a question though:

How does one remove the text form the same column as where the icons are? I see in your example, the icons are in their own column, but when I follow the same steps, my column contains the icons on the left, and the text on the right. How can I only show the icons and not display the text?

Thank you in advance.

Highlighted
Super User IV
Super User IV

Re: Icons Conditional Formatting by Field - How to not display the text next to the comlumn

Hello @JWSouthAfrica 

In the conditional formatting window you can set it to show icons only.

IconsOnly.jpg

Highlighted
Advocate I
Advocate I

Re: Icons Conditional Formatting by Field

Thank you

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors