Skip to main content

Tutorial: Adding Custom Icons to Milestones

You are here:

The Milestone Trend Analysis chart supports custom icons, giving report authors additional flexibility to align visuals with their organization’s branding. Icons need to be provided as Base64-encoded images, including the necessary metadata header.

There are two ways to convert your icon to Base64:

  • Convert using Power Query (M Query)
  • Convert using an external tool

Convert using Power Query (M Query)

1. Add a Table with the image/icon URLs

  1. Prepare your icon
    • Download or design your own icon. Supported formats: SVG, PNG, JPG and GIF.
    • Keep the file small and use a transparent background for best results.
    • Tip: For SVGs, you can use  currentColor for fill and border. This allows icons to dynamically adapt to the chart’s color settings.
  2. Create the Icons table with the following columns: ID, Name/Category and URL/SVG.
  3. Convert the Icon to Base64
    • Import your Icons (Excel) file into Power Query. You can do the Base64 conversion directly in Power BI by using the Binary.ToText function with the BinaryEncoding.Base64 option in Power Query (click on the screenshot to see the Applied steps).
  4. Set the Data Category.
    • In Power BI, change the Data category of the “Base64/URL” column to Image URL.

2. Link Tables

Connect the Icons table with your main dataset.

  1. Click Model view from the left menu.
  2. Click on the Manage relationships from the top menu.
  3. Click + New relationship.
  4. From the first drop-down, select your Dataset table and click the column with the Icon IDs.
  5. From the next drop-down, select the “Icons” table you just added and select the column with the MilestoneIcon IDs. This ensures the right icon is pulled in dynamically for each row.
  6. Leave the defaults: Cardinality = Many to one (*:1), Cross filter direction = Single.
  7. Click OK, then Close.

Your “Icons” table is now linked to your dataset.

3. Build & Format visual

Add a Milestone Trend Analysis chart to your report and map the “URL” category from the “Icons” table to the Milestone icon well.

  1. In Power BI, open or locate the report with the Milestone Trend Analysis chart.
  2. Add at least the following categories: Milestone, Milestone Date, Reporting Date.
  3. Add the “URL” category into the Milestone icon well.
  4. Open the Format visual pane and expand the Milestones and/or Lines cards to customize the visual to your preferences.
  5. For SVGs using currentColor for fill and border, icons will automatically adopt the corresponding legend color. Change the Color using the Apply settings to dropdown, and adjust the icon size under Lines > Marker size.
  6. Save your Power BI report and publish it to the Power BI service.

Convert using an external tool

Use this method if you prefer a quick conversion outside of Power BI.

  • Prepare your icon. Download or design your icon (supported formats: SVG, PNG, JPG, and GIF). Keep the file small and use a transparent background for best results. For SVGs, you can use currentColor for fill and border to allow icons to dynamically adapt to the chart’s color settings.
  • Create an Icons table with the following columns: ID, Name/Category, and URL/SVG.
  • Convert your icon to Base64 using an online tool (search for “Base64 image encoder”). Copy the generated Base64 string and paste it into the URL/SVG column of your Icons table.
  • Import your Icons (Excel) file into Power BI.
  • Set the Data Category. In Power BI, change the Data category of the URL/SVG column to Image URL.
  • Link the Icons table to your dataset. Follow the same steps as 2. Link tables.
  • Build and format the visual. Follow the same steps as 3. Build and format the visual.

Considerations

If your images appear cropped or only partially displayed when using Base64 URLs, it’s likely due to Power BI’s character limit for text fields. The Power Query engine supports a maximum of 32,766 characters per text cell. Any text exceeding this limit will be truncated, resulting in incomplete image rendering.
To avoid this issue:
– Use SVGs where possible (smaller for icons/logos).
– Reduce the image resolution to minimize file size.
– For images, use compressed JPG format rather than PNG, since JPG files are smaller.
– Compress images to approximately 20–25 KB to stay within the Power BI character limit.

Table of Contents