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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
snandy2011
Helper IV
Helper IV

Some SVG codes not running on Power BI

Hi Experts,

 

I am learning now creating SVG image on Power BI. I have some multiple SVG code, which run perfectly on any editor, but when i put those code on Power BI,it shows nothings. Is there any rule to write SVG code on Power BI?

 

for example, I have a simple below polygon code, which is running perfectly on editor, but not on Power BI,

 

"data:image/svg+xml;utf8," &
 "<svg 
             
 height='500' width='500' fill = 'Green'>
		    <polygon points='250,60 100,400 400,400' />
        <animateMotion
       path='M 20 20 V 50 Z'
       dur='3s' repeatCount='indefinite' />
		    
	  </svg>"
 
Can you please identify what wrong in this code?Not only this code, I have some svg codes which is not running on Power Bi.

 

Any suggesation is really appreciable.

 

Thanks,

Snandy

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi Snandy,

 

Please download the demo from the attachment. 

The only difference between the 1 and the 2 is the blue part in the code below. If you'd like to show them in a Table visual, you need to change the "Data category" to "Image URL".

data&colon;image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height='500' width='500' fill = 'Green'><polygon points='250,60 100,400 400,400' /><animateMotion path='M 20 20 V 50 Z' dur='3s' repeatCount='indefinite'/></svg>

Some-SVG-codes-not-running-on-Power-BI

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi Snandy,

 

Please download the demo from the attachment. 

The only difference between the 1 and the 2 is the blue part in the code below. If you'd like to show them in a Table visual, you need to change the "Data category" to "Image URL".

data&colon;image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height='500' width='500' fill = 'Green'><polygon points='250,60 100,400 400,400' /><animateMotion path='M 20 20 V 50 Z' dur='3s' repeatCount='indefinite'/></svg>

Some-SVG-codes-not-running-on-Power-BI

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

can you render an svg on anything else other than a table?  I'm looking for a single cell widget to display an image for an indicator.  I've tried image grid and simple image.

Thanks for your solution..It works

 

Anonymous
Not applicable

This SVG code works fine for me, however the first string is not needed you only need the part inbetween the SVG tags.

 

Have you read this series of blog posts on SVG images in Power BI?

https://dataveld.com/2018/01/13/use-svg-images-in-power-bi-part-1/ 

https://dataveld.com/2018/01/15/use-svg-images-in-power-bi-part-2/

https://dataveld.com/2018/07/16/use-svg-images-in-power-bi-part-3/

 

Edit: you need to have the data in columns for the HTML viewer to work, measures do not work in my experiance.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors