Forum Discussion
Is there a Json example for adding custom icon to a custom theme .json file?
I'm trying to add a custom icon set to the existing custom theme below:
{
"name": "Master Theme",
"dataColors": [
"#ffffff",
"#101010",
"#0190ca",
"#6a89a5",
"#CF701A",
"#8E8B02",
"#344489",
"#44AA8C",
"#69469C",
"#E28EBC",
"#A02387",
"#F6B53D",
],
"visualStyles": {}
}
I found this post https://community.powerbi.com/t5/Desktop/Adding-a-custom-icon-to-a-custom-theme-json-file/m-p/2455220#M876692 where the person said they were able to do it.
Using the above link, I created a seperate theme file for the icons below and it works:
{
"name": "Cusotm Icons",
"icons": {
"AV_Circle": {"description": "AV Circle", "url": "data:image/png;base64...blahblahblah"}
}
Having them as seperate files doesn't work becuse when selecting a custom theme in Power BI, you can only have one applied at a time. So if I wanted colors, I'd lose icons and vice versa.
So I thought maybe I could merge them by modfying the first JSON like so, but Power BI gives an import error:
{
"name": "Master Theme",
"dataColors": [
"#ffffff",
"#101010",
"#0190ca",
"#6a89a5",
"#CF701A",
"#8E8B02",
"#344489",
"#44AA8C",
"#69469C",
"#E28EBC",
"#A02387",
"#F6B53D",
],
"visualStyles": {},
"icons": {
"AV_Circle": {"description": "AV Circle", "url": "data:image/png;base64...blahblahblah"}
}
I can't find any examples online of a custom theme JSON with both color pallete/visual AND icons. Is this even possible?
Thank you
- Anonymous3 years ago
I found this as a way to import BOTH custom colors and custom icons. One of the mistakes I made was leaving the comma (circled above) out of the code. As soon as I added this into the code, I was able to import it successfully.
Additionally, I found this post about saving the theme as a template:
https://community.powerbi.com/t5/Desktop/Organizational-Default-Theme/m-p/593898
3 Replies
- AnonymousNot applicable
HI Cayshin,
I'd like to suggest you refer to the following blog about using Base64 string as the background image in theme files:
Power BI Theme with Background Image – PBI Guy (pbi-guy.com)
Regards,
Xiaoxin Sheng
- CayshinFrequent Visitor
Anonymous Thanks for taking the time to reply; however, that blog post doesn't answer or pertain to my question. The blogpost answers how to set a background in "visualStyles": {} which is not what I'm trying to do.
A Custom Icon theme affects the selectable icons when applying conditional formatting.
BEFORE CUSTOM ICON THEME APPLIED
AFTER CUSTOM ICON THEME APPLIED
(Ignore the 'broken image' icons, they still work. I know how to fix it, I just haven't yet)
If at any point I switch to using a different theme, the custom icons seen in the image above will dissapear.
So it ends up that I can have either custom icons and Power BI's default color theme OR my own custom color theme but no custom icons.
This is why I'd like to know how to have both a color palette AND icons set within the same custom theme JSON.
- AnonymousNot applicable
I found this as a way to import BOTH custom colors and custom icons. One of the mistakes I made was leaving the comma (circled above) out of the code. As soon as I added this into the code, I was able to import it successfully.
Additionally, I found this post about saving the theme as a template:
https://community.powerbi.com/t5/Desktop/Organizational-Default-Theme/m-p/593898