Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Babak_Samet
Regular Visitor

Status icons with dynamic numbers in a cell

Hello Power BI Community,

I’m working on a report where I need to display multiple status icons (in SVG format) in a table, with dynamic numbers overlaid on top of the icons. The status icons represent different status types (A to D), and each status is associated with a number (starting from 1), which is calculated based on other columns in the dataset. 

Here’s what I’m trying to achieve:

  1. Display SVG icons representing different statuses (A, B, C, D) in a single row of a table.
  2. Overlay a dynamic number inside or on top of the corresponding SVG icon based on a calculated value. Ideally, the numbers should appear inside the icon itself, similar to how DAX measures generate SVG images dynamically.

I created a DAX measure to return the corresponding icon URL based on the status and added the measure to a Table visual. The icons however do not display correctly even when I set the Data Category to "Image URL". I’m also struggling to figure out how to overlay dynamic numbers on top of or inside the icons. 
Here is an example of the measure I created for this porpuse:

StatusA_SVG =
IF(
NOT(ISBLANK([StatusAValue])),
"<svg width='40' height='40' xmlns='http://www.w3.org/2000/svg'>
<circle cx='20' cy='20' r='18' fill='blue' />
<text x='20' y='25' font-size='16' fill='white' text-anchor='middle'>" & [StatusAValue] & "</text>
</svg>",
BLANK()
)


Is there a way to overlay dynamic numbers on top of external SVG icons in Power BI, similar to how text can be added to dynamically generated SVGs in DAX? 
If overlaying numbers directly inside SVG icons isn’t possible, are there alternative approaches to display icons and their associated numbers together in a table format?

I would really appreciate any guidance or suggestions on the best way to display these status icons with dynamic numbers in Power BI.

Thanks in advance for your help!

 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You are nearly there, just need to make your text string look like an actual image URL.

 

Add the required prefix as explained here.

 

Use SVG Images in Power BI: Part 3 - DataVeld

 

You will also want to add a viewport.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

You are nearly there, just need to make your text string look like an actual image URL.

 

Add the required prefix as explained here.

 

Use SVG Images in Power BI: Part 3 - DataVeld

 

You will also want to add a viewport.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors