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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
robmarsh
Frequent Visitor

SVG graphic with <a> hyperlink

I am getting into creating custom visuals using SVG code in measures using the "Image URL" as the Data Category. I am struggling to get hyperlinks to be recognised inside the SVG though. For example, I have a measure that has some text inside an <a> tag like the below:

 

test svg = 

VAR _svg = "data&colon;image/svg+xml;utf8, <svg height=""600"" width=""200"" xmlns=""http://www.w3.org/2000/svg""><a href=""https://www.w3schools.com/"" target=""_blank"" onclick=""window.open('print.html', 'newwindow', 'width=300,height=250'); return false;""><text x=""0"" y=""30"" fill=""red"" font-size=""30"">CLICK HERE!</text></a></svg>"

RETURN _svg

 

 This displays as expected when dragged into a matrix or table, but when Ihover over the CLICK HERE! text it doesn't recognise the hyperlink. I have tried publishing to Power BI service also, but the same issue is there. Is this functionality not supported in Power BI yet?

 

Thanks

5 REPLIES 5
robmarsh
Frequent Visitor

Thanks @rajendraongole1. I think that would still not allow me to the functionality into the matrix, so for now I am going to stick with the Web URL measure and hope that Microsoft open up the SVG functionality at a later date. Thanks for your advice though 👍

Hi @robmarsh ,

Glad to hear you may have found a solution! If you're sure the issue has been resolved, could you mark this post as resolved? That way, others with similar issues can more easily find a solution and the community can see that the issue has been resolved.
Thanks, and feel free to reach out if you need further help!

robmarsh
Frequent Visitor

Thanks for your reply @rajendraongole1. Buttons won't work in this scenario, as I need to create a dynamic button where the URL changes and add it into a matrix.

 

It's strange that the functionality is limited for security reasons, as the funtionality is very similar to creating a Web URL measure. This incidentally does work, except I wanted a way to create something that looked like a button. Also, I haven't found a way yet of forcing Web URL links to open in a new window rather than a new tab on the existing window. Does anyone know how to do that?

Hi @robmarsh -For now, you’ll need to rely on the Web URL measure and accept that it opens in a new tab or explore Power Apps if you need full control over button appearance and hyperlink behavior. Unfortunately, due to Power BI's current security constraints, finer control over link behavior (like forcing a new window) is unavailable directly within Power BI visuals.

Alternative Solution: 

Power Apps provides more flexibility, allowing for custom-styled buttons that can open URLs in a new window.

You could create buttons with dynamic URLs based on Power BI data, and configure them to open in a new browser window.

 

 





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

Proud to be a Super User!





rajendraongole1
Super User
Super User

Hi @robmarsh - Unfortunately, if you’re looking for true hyperlink functionality directly in SVG-based visuals within measures, this isn’t supported in Power BI due to security and performance restrictions on interactive content.

suggest an alternative:

You can use buttons or images in Power BI that link to external content via the action feature. While it doesn’t provide the same customization as SVGs, it can be an alternative if your goal is to navigate to a URL.

 

Hope this information helps.

 





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

Proud to be a Super User!





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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

October NL Carousel

Fabric Community Update - October 2024

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