Press "Enter" to skip to content

Power BI: Using Images as Matrix Column Headers

Last year I was put on a project where the customer had a requirement to use logo images as the column headers on a matrix visualization. I wasn’t sure how to do this but I was determined to figure it out and then one day I happened to be sitting next to Will Thompson at the Data & BI Summit in Dublin, Ireland. Thanks to the help of Will I was able to get it done. BTW, thanks Will for your help!

I recently demoed how to do this in my workshop at the #MSBizAppsSummit. The solution is quite simple and here are the steps I did to make it work.

So you can see how it works first setup your matrix visual with the data you want to use including using a text column for the header. Then continue with the steps below to replace the header column with logo images.

Superheros

Step 1: Upload images

  • Upload your images to a public facing (anonymous) location.
    • For my images I published them to a Linux web server that I’m using to host WordPress and other sites. Currently images have to be public otherwise the images will come up missing.
      There is currently no support for using authenticated locations for images as I was told this is not an easy feature for the PBI team to implement as it’s harder to figure out passing through authentication.
    • Name the images in the order of the sort you want them to be in (i.e. numerical or alphabetical).

Step 2: Add new column to data for image URL

  • There are 3 options I can think of that you can do for the image URL.
    1. Add the URL as an additional column to your original data source (not the best approach).
    2. Add a conditional column in your PBI data model.
    3. Create a disconnected table to store the values for the image URLs.

For this example, I’m going to show you how to do option #2 of adding a conditional column to the data model.

  • Edit Queries

EditQueries4

  • Add Conditional Column

AddCondColumn2

PublisherLogoAdd3

  • You should now have your new calculated column displaying the image URL then click Close & Apply.

CloseApply

  • Add your newly created column to the Matrix visual and remove the column you are replacing.

DragNewColumn

  • The image URL should be showing up as your column header in the matrix. The reason the column is showing up as raw text is because Power BI Desktop is not recognizing the data category type.

DragColumnDone

Step 3: Update Data Category Setting

  • Select the new column and set the Data Category property to Image URL.

DataCategory

You should now see your images show up as the column headers.

ColumnHeaderImages

Step 4: Update the Matrix Visualization Image Height

  • Set the Image height in the Format properties to desired height and continue to format your matrix until you have it exactly the way you want displayed on the report.

FormatImageHeight

You can also do the same for matrix row headers.

RowHeaders

One Comment

  1. axel
    axel June 17, 2019

    Hi Christina,
    Wonderful trick. Many thanks for your sharing.

    I have a question whether Power BI able to show images from one of Microsoft Dynamics family, Dynamics 365 F&O ?

    Thanks again, great post.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: