Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Creating cutom icons for conditional formatting

Hi all,

 

I'm trying to add custom icons to conditional formatting. I understand that I need to upload a Json file as a theme which will include SVG instructions for my new icons.

 

However, I'm not a coder and when I read all the forums on how to use svg etc., I understand the concept but the application is too advanced for me.

 

What makes it more complicated is that I already have a custom theme which I use and when I replace it with a new Json, my custom theme disappears. So I understand that the two things (i.e. custom colours and icons) need to be uploaded as a one file.

 

My current theme is as follows:

 

{"name":"Custom","dataColors":["#031F73","#374649","#FD625E","#F2C80F","#5F6B6D","#8AD4EB","#FE9666","#A66999","#3599B8","#DFBFBF","#4AC5BB","#5F6B6D","#FB8281","#F4D25A","#7F898A","#A4DDEE","#FDAB89","#B687AC","#28738A","#A78F8F","#168980","#293537","#BB4A4A","#B59525","#475052","#6A9FB0","#BD7150","#7B4F71","#1B4D5C","#706060","#0F5C55","#1C2325"]}

 

The custom icons I'd like to add are two circles: one circle 'GreenAmber' (half green/half amber) and one circle 'RedAmber' (half amber/half red).

 

Am I missing something? How do I link the two themes and how do I set coordinates to have two colours in one circle? Most of the basic advice shows how to produce a uniform geometric shapes.

 

I'd appreciate your help and support! Thank you!

1 ACCEPTED SOLUTION
NikhilChenna
Continued Contributor
Continued Contributor

Hi @Anonymous , I think below is the solution which will work and its easy ,

Please go through the below link it has steps how to add custom icons,

https://pbivisuals.com/2021/10/29/how-to-add-custom-icons-in-power-bi-conditional-formatting/

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

View solution in original post

10 REPLIES 10
NikhilChenna
Continued Contributor
Continued Contributor

Hi @Anonymous , I think below is the solution which will work and its easy ,

Please go through the below link it has steps how to add custom icons,

https://pbivisuals.com/2021/10/29/how-to-add-custom-icons-in-power-bi-conditional-formatting/

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Hi @NikhilChenna,

 

Thanks for your suggestion. I had a look at your blog but unfortuntely I fail on step 2, as the simple icons I require are not there. I'm looking for something like this: 

Amber Red.pngGreen Amber.png

Hi @Anonymous , You already have downloaded the 2 images right.

 

Follow the link from step 3 by converting the image to Base 64 using Base 64 encoder.

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

@NikhilChenna , thanks for that. So I understand that Base 64 will help me to create a Json code. How do I then merge the new code from Base 64 with the code I already have (see above in my original post)? Do I just copy past below or do I need to link them together?

Anonymous
Not applicable

@NikhilChenna 

PS. I followed the steps just to test it and it seems to work but my icons are tiny in comparison to the other ones:

Icons.jpg

 

 

 

 

 

 

 

 

But I feel the solution is nearly there, just these two questions remain:

 

1) How to merge the two codes?

2) How to enlarge the icons?

 

Thanks!

Hi @Anonymous ,

 

As the inital question of adding the icons is solved.

Please Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

For the above 2 questions I'll try to find a solution but i think currently there is no option of enlarging the custom icons. 

Your demand is a good idea, while it is not supported to implement in Power BI currently.


You can vote up this idea for this function:
Let us increase the size of Icons when we conditional format

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

Hi @Anonymous , You can replace the old code with the new code which is present in the link. Please follow it step by step.

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Thanks @NikhilChenna for the suggestion, maybe I'm not being clear here. I don't want to replace one code with the other - I still need to keep my previous theme as it helps maintain institutional colours throughout the reports. I need to keep the code for the colours and the new icons as one json.

amitchandak
Super User
Super User

@Anonymous , I usually create an icon measure using unichar and then do conditional formatting using field value option

 

/////Arrow
Arrow =
var _change =[Net Sales YTD]-[Net Sales LYTD]
return
SWITCH (
TRUE(),
_change > 0, UNICHAR(9650),
_change = 0, UNICHAR(9654),
_change < 0, UNICHAR(9660)
)


/////Arrow Color
Arrow color =
var _change =[Net Sales YTD]-[Net Sales LYTD]
return
SWITCH (
TRUE(),
_change > 0, "green",
_change = 0, "blue",
_change < 0, "red"
)

 

UNICHAR - Tool for Custom Icon Formatting: https://www.youtube.com/watch?v=veCtfP8IhbI&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=50

 

list : https://exceleratorbi.com.au/dax-unichar-function-power-bi/

 

more examples

https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692

Anonymous
Not applicable

Hi @amitchandak,

 

Thanks for your suggestion. I can see your point, but I think my problem is more with the actual icon I'm trying to upload which is simple but very specific - it's a circle with two colours in them. Any ideas how to deal with that? Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.