Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

how to package local images?

can I use local image in custom visual?I do like this:


but get error,because <iframe>/<sand-box>.


I‘m new developer of powerbi custom visual,can I use local image(finnaly package in visual) in custom visual?




Helper I
Helper I


the local resources can't package into *.pbiviz?

Hi @luojiandan_bi,

I personally haven't tried it this way - it looks like Webpack will not recognise the variable assignment as a file and skip over it.

When working with images, I tend to declare them as CSS classes I can use in the visual.less file, and these get encoded when the visual is packaged. They're much easier to work with in the DOM too this way, IMHO. Here's an example of how I do it for Deneb.

If this approach doesn't work for you, I'd advise either creating an issue in the powerbi-visuals-tools Github project  or contacting the team at for further details, as they don't monitor these forums and may be able to provided you with more targeted info.

Good luck,


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

Proud to be a Super User!

My course: Introduction to Developing Power BI Visuals

On how to ask a technical question, if you really want an answer (courtesy of SQLBI)

Helpful resources

PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Top Solution Authors