Here’s a question from a colleague:
“I’ve created a sales performance dashboard in Power BI, but it looks a bit plain. How can I add icons to my table and card visuals to make the data more visually appealing and easier to understand at a glance?”
Adding icons to your Power BI visuals can significantly enhance data comprehension and aesthetic appeal. This tutorial will guide you through the process of incorporating icons into both table and card visuals using a sales performance scenario.
Data Model
For both examples below we will assume that the following data model exists:
- Table: SalesData
- Data Fields: Date: date, Product: text, SalesAmount: currency, SalesTarget: currency, Region: text, SalesRep: text
Creating measures for your analysis
Create two measures that will be used in your analysis using the following DAX
Total Sales = SUM('Your Table Name'[Your Sales Column])
Sales Target = SUM('Your Table Name'[Your Target Column])
Adding Icons to Power BI Tables
- Create a new measure for determining the icon:
Performance =
IF(
[TotalSales] >= [TotalTarget],
UNICHAR(128994), // Green circle
UNICHAR(128308) // Red circle
)
- In Power BI Desktop, select your table visual.
- In the Fields pane, drag the newly created ‘Performance’ measure into the Values section of the table.
- To change the icon colors:
- Click on the ‘Performance’ column in the table.
- In the Column tools, select ‘Conditional formatting’ > ‘Icons’.
- Choose ‘Field value’ as the Format by option.
- Set up rules to match your UNICHAR values and desired colors.
- Adjust column width as needed to properly display the icons.
Adding Icons to Cards in Power BI
- Create a measure for the card’s main value (e.g., Total Sales).
- Create an additional measure for the icon:
Card Performance =
IF(
[Total Sales] >= [Total Target],
UNICHAR(128077), // Thumbs up
UNICHAR(128078) // Thumbs down
)
- Add a new card visual to your report.
- In the Visualizations pane, expand the ‘Title’ section.
- In the ‘Title text’ field, enter your desired title for your performance card.
- Format the title as needed (font, size, color) in the ‘Title’ section.
- Below is an example of our small dashboard:
Key Concepts
- UNICHAR function: Converts Unicode numbers into their corresponding characters, allowing you to use a wide range of icons.
- Conditional formatting: Enables dynamic icon display based on data values.
- Measures: Allow for complex calculations and logic to determine which icon to display.
Troubleshooting
If the icons don’t appear in your visualizations:
- Ensure your UNICHAR values are correct.
- Check that your measures are correctly placed in the visual’s field wells.
- Verify that your data model matches the assumed structure.
- For tables, make sure conditional formatting is properly set up.
- If using custom fonts, ensure they support the Unicode characters you’re using.