How to Use Pictures in Your Power BI Power View Dashboards

6 comments

If you used pictures in your Power View dashboards and tried to deploy these dashboards in your Power BI tenant you are likely to have seen the following warning message:

“UNSUPPORTED FEATURES External pictures can’t be displayed in Power View Sheets in Office 365”. My guess it’s only a matter of time when external pictures are treated with respect by Power BI, however, in the meanwhile, I wanted to write about a workaround that will alleviate some of the pain caused by this inconvenient lack of support.

Unfortunately, the workaround is not a good fit for a self-service use case as it requires an instance of SQL Server database and some SQL writing skills.

The first step is to create a table that will house your images:

CREATE
TABLE [dbo].[Something](

    [ID] [int] NULL,

    [SomethingDesc] [nvarchar](100)
NULL,

    [ImageOfSomething] [varbinary](max)
NULL

)
ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

 

Now, assuming you have the ID and SomethingDesc fields already populated, you need to load the images for each record of something. A sample SQL to do that will look something like this:

update Something set ImageOfSomething = (SELECT image_data FROM OPENROWSET(BULK N’C:\SomethigID1.jpg’, SINGLE_BLOB) AS ImageSource(image_data)) where ID =1

update Something set ImageOfSomething = (SELECT image_data FROM OPENROWSET(BULK N’C:\SomethigID2.jpg’, SINGLE_BLOB) AS ImageSource(image_data)) where ID =2

etc…

Now that the images are loaded in your SQL table, they can be pulled into your Power Pivot model just like a regular field. It is probably a good idea to then go to the Advanced tab in your Power Pivot window and make sure the Data Category for the image field is set as Image

And the Default Image is set correctly in the Table Behavior screen.

Now you can use Images for visualizations as described in this article, deploy your dashboards to your Power BI site and enjoy the enhanced visualization mojo.

6 comments on “How to Use Pictures in Your Power BI Power View Dashboards”

  1. Hey there, thanks for the blog post! One question is I have is can you easily get Power View to render a URL link to an image rather than a file share?

  2. Hi,
    I tried the method of uploading the images from SQL in Power Pivot Model..but still I get the camera icons in Power View 😦
    What am I doing wrong?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s