- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 👍
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Proud to be a Super User! | |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Proud to be a Super User! | |
