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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Change a SVG with href code

Hello everyone,

 

I really like to work with SVG's in Power BI. Especially because you can visual a percentage in an image. When I convert a png to a svg, I get the code 'href=', followed by the code of the image itself. A href code allows for the preservation of the originial colors of the png (in comparison with 'path='). However, I don't know if it's possible to add the following code to the SVG:

 

<defs>

               <clipPath id='maskClip'>

               <rect x='0' y='0' width='374' height='100'/>

               </clipPath>

</defs>

 

style= 'fill: grey; clip-path:url(#maskClip)' >

 

This code should be added in the SVG Skyline New York. Since that code is long, I have pasted that in a Drive. You can click on the link down below. 

To give an example I am looking for: 

For example, when the result for something is 70%, I want 70% of the image should be visible, the remaining should be covered with the color grey. (The percentage is dynamic and I already have a measure for that). The point is, I want to adjust the SVG so that it can be covered with the color grey (or any color for that matter). 

 

I hope I explained it thoroughly enough.. If not, please let me know!

 

Skyline New York.png

 

SVG Skyline New York 

1 ACCEPTED SOLUTION
KerKol
Power Participant
Power Participant

Hi,

You can do this with HTML but it becomes tricky when trying to get viewbox and image size the same.

 

You may find it easier with PureViz.

In PowerPoint, you can lay your image down and add a shape over the top exactly the same size.

KerKol_1-1649077887203.png

 

Then you can select both the image and the shape and save as svg.

 

Import this svg into the PureViz Custom visual.

 

Select the shape, add a dynamic formula to change the size according to your data...

KerKol_2-1649077986231.png

 

KerKol_3-1649078009045.png

 

KerKol_0-1649077807022.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
KerKol
Power Participant
Power Participant

Hi,

You can do this with HTML but it becomes tricky when trying to get viewbox and image size the same.

 

You may find it easier with PureViz.

In PowerPoint, you can lay your image down and add a shape over the top exactly the same size.

KerKol_1-1649077887203.png

 

Then you can select both the image and the shape and save as svg.

 

Import this svg into the PureViz Custom visual.

 

Select the shape, add a dynamic formula to change the size according to your data...

KerKol_2-1649077986231.png

 

KerKol_3-1649078009045.png

 

KerKol_0-1649077807022.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@KerKol This is great!!! Thanks you so much. I didn't know this visual. It works so convenient and offers so many new options! 

You're very welcome 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




lbendlin
Super User
Super User

should be possible. However your link is requiring access.

Anonymous
Not applicable

Oh my apologies! 

 

I changed it, so the link is not available for everyone:

 

Skyline New York 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors