Forum Discussion
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!
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!
10 Replies
- amitchandakSuper 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- AnonymousNot 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!
- NikhilChennaSkilled Sharer
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!- AnonymousNot 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:
- NikhilChennaSkilled Sharer
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!