Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Import custom icons into Power BI |
---|
Icons can add a little extra something to your reports. Working out how to do this using JSON files is tricky and in this blog we will cover how! |
In this blog
Custom icons are a great way to tailor a Power BI report, giving it that custom feel.
Simple images tend to work best, but where is the fun in that?
To add custom icons, you need to modify your existing report theme. To begin, export your current theme by choosing View | Save current theme from the Power BI Desktop ribbon and then choose where to save the generated file.
Power BI will export the theme as a JSON file.
You can edit the exported file in a text editor such as Notepad but I prefer using the website JSON Editor Online.
Choose Open | Open from disk and select your theme.
Your theme is made up of multiple sections, for example dataColors, which contains all the base colours of your report.
We need to add a new section called icons to this list.
To make your life easy, here's an example of the basic structure of the icons section providing the details of two custom icons. Each icon includes the name, a description which will appear as a tooltip and finally the URL of the image.
"icons": {
"WiseOwlLogo": {
"description": "WiseOwlLogo",
"url": "https://www.wiseowl.co.uk/Images/blue/Wise-Owl-training.png"
},
"WiseOwlXmasLogo": {
"description": "WiseOwlXmasLogo",
"url": "https://www.wiseowl.co.uk/Images/blue/Wise%20Owl%20Christmas%20Logo.jpg"
}
},
Modify this code with your own icon names and URLs and then paste it into the JSON list.
This section is added at the same level as the existing ones, no nesting required!
Now you can export this modified JSON file to disk by choosing Save | Save to disk or to a shared OneDrive location using Save to cloud.
Choose your save location and give the file a name.
In Power BI you can now import the modified theme by choosing View | Browse for themes from the ribbon.
Power BI will launch a new Open file window.
Navigate to the modified JSON file and choose to open it.
Make sure not to choose the old file by mistake!
To see your newly added icons we first need to create a table visual.
Choose Table from the Visualizations panel.
Now we can apply some conditional formatting by toggling on Icons under Visual | Cell elements in the Visualization pane.
You can swap columns by using the Series dropdown.
From here you can apply different Rules to decide which Icons to show.
Here I am assigning icons based on the value of the row.
Click OK and Power BI will add your new icons into the table visual.
Ideally the images should be of an appropriate aspect ratio for your visual.
Some other pages relevant to the above blog include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.