How to Add Icons to Tables and Cards in Power BI?

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

  1. Create a new measure for determining the icon:
   Performance = 
   IF(
       [TotalSales] >= [TotalTarget],
       UNICHAR(128994), // Green circle
       UNICHAR(128308)  // Red circle
   )
  1. In Power BI Desktop, select your table visual.
  2. In the Fields pane, drag the newly created ‘Performance’ measure into the Values section of the table.
  3. 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.
  1. Adjust column width as needed to properly display the icons.

Adding Icons to Cards in Power BI

  1. Create a measure for the card’s main value (e.g., Total Sales).
  2. Create an additional measure for the icon:
   Card Performance = 
   IF(
       [Total Sales] >= [Total Target],
       UNICHAR(128077), // Thumbs up
       UNICHAR(128078)  // Thumbs down
   )
  1. Add a new card visual to your report.
  2. In the Visualizations pane, expand the ‘Title’ section.
  3. In the ‘Title text’ field, enter your desired title for your performance card.
  4. Format the title as needed (font, size, color) in the ‘Title’ section.
  5. 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.

Applying Icons Across Different Visual Types

Matrix Visuals with Hierarchical Icons

Matrix visuals support the same UNICHAR technique but offer additional opportunities for nested performance indicators. Create separate icon measures for different hierarchy levels (Region, Product Category, Individual Product) and apply conditional formatting at each level. This allows executives to drill down from high-level regional performance icons to product-specific indicators without losing visual context.

KPI Visuals with Dynamic Trend Icons

While standard card visuals show static icons, KPI visuals can display trend indicators automatically. Combine your icon measures with KPI visual’s built-in trend axis by setting your Total Sales as the indicator, Sales Target as the target goal, and creating a time-based measure for the trend axis. The KPI visual will automatically generate trend arrows, which you can supplement with your custom UNICHAR icons in the indicator value formatting.

Considerations of Performance and Refresh speed

Icon-based measures are calculated during report refresh and visual rendering. If your dataset contains millions of rows, consider creating calculated columns for static icon assignments instead of measures for frequently used icons. This pre-calculates icon values during data refresh rather than on-demand visualization, improving dashboard responsiveness.

Troubleshooting

If the icons don’t appear in your visualizations:

  1. Ensure your UNICHAR values are correct.
  2. Check that your measures are correctly placed in the visual’s field wells.
  3. Verify that your data model matches the assumed structure.
  4. For tables, make sure conditional formatting is properly set up.
  5. If using custom fonts, ensure they support the Unicode characters you’re using.