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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
gubesh
Frequent Visitor

Import SVG from local file to Power BI custom visual

Hi fellow developers!

I am finishing my custom Power BI visual and I can´t succesfully load pictures into the custom visual from the local files (using assets folder). I am sending the image with the error (you can see that there is this "image missing" symbol) .

gubesh_0-1724527618432.png

Basicaly I declared image as SVGElement. I created it in construct method as image. And in update method I tried to join path with xlink:href. The visual works in that way, that "image" is shown in Power BI online in correct place, but actual image is not loaded you can see only that error. I expect error in path, code, security or some settings that I dont know.
I read previous comments in community. I would highly appreciate any help from more experienced developers. Thank you!

Snipets of my code from visual.ts

gubesh_2-1724526897129.png

gubesh_3-1724526932936.png

gubesh_4-1724526946351.png

Greetings from Prague!

Jakub Planka

 

@Greg_Deckler,  @lbendlin,  @Kaviraj11,  @Vil @v-shex-msft,  @EscritórioDados 
@v-asoronov @v-rzhou-msft @v-yangliu-msft 

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @gubesh ,

 

I think you can refer to below offical blog to learn more details about SVG in Power BI Custom Visual.

For reference:

Introduction to SVG utils in Power BI visuals - Power BI | Microsoft Learn

I hope it could help you solve your issue.

 

Best Regards,
Rico Zhou

 

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

Hi!
This article does not help me to find answer to my problem. I need to import a picture PNG or SVG file from local folder. Picture like companys logo.

However the article was super informative, and I thank you for that. I will use this reference in my future project!

However problem still open.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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