Forum Discussion

Mousemo's avatar
Mousemo
New Member
2 years ago
Solved

PowerBi Images don't display

I'm having problems getting local network images to display.  I can get a static network image (via Insert - Image) and Web URL images to display fine but any network image in a Table/Multirow card, card, or using the Simple Image visual doesn't display.  I've tried using the local C: drive or a networked drive and they don't display.  Attached is a sample of the PowerBi page, you can see the Web URL and Static images are fine but the others are not.  I've made sure those are set as Image URL and tried a couple of different file path formats.

 

Any ideas to get these images to display?


Thanks

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Your ideas is so great hnguy71 

    Hi, Mousemo 

    You can work with your photos by following the steps below:

    First, there is an image folder in my local directory:

    We need to follow these steps in Power BI:
    Start by importing a folder in Power BI:

     

     

    Convert this column to a text type:

    Add a custom column:

    Enter the following expression:

    "data:image/" & [Extension] & ";"&"base64,"& [Content]

    Go back to Power BI and use this custom column:

    Use this custom column in the table visual:

     

     

    Best Regards

    Jianpeng Li

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

     

     

     

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Your ideas is so great hnguy71 

    Hi, Mousemo 

    You can work with your photos by following the steps below:

    First, there is an image folder in my local directory:

    We need to follow these steps in Power BI:
    Start by importing a folder in Power BI:

     

     

    Convert this column to a text type:

    Add a custom column:

    Enter the following expression:

    "data:image/" & [Extension] & ";"&"base64,"& [Content]

    Go back to Power BI and use this custom column:

    Use this custom column in the table visual:

     

     

    Best Regards

    Jianpeng Li

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

     

     

     

  • hi Mousemo ,
    For any local files you'll need to convert them to base64 format, but before that you'll need to further determine if source is local or web.

    Once you've determined if source is local then you'll need to create a new column with the following code:

     

     

     

            let 
                binary = [Content], 
                base64 = Binary.ToText(binary, BinaryEncoding.Base64), 
                extension = Text.AfterDelimiter([Extension], ".", {0, RelativePosition.FromEnd}), 
                prefix = "data:image/" & extension & ";base64," 
            in 
                prefix & base64

     


    Note: the column [Content] refers to the column where your image information is stored. It's default called [Content] but you may have adjusted the base column with something else. Adjust as necessary.

    EDIT: For some reason the colon is getting replaced on my screen. Just in case, here's a screenshot:

     

    • Mousemo's avatar
      Mousemo
      New Member

      Thanks for that suggestion.  I tried your code and here's the error I received.

      • hnguy71's avatar
        hnguy71
        Icon for Super User rankSuper User

        Hi Mousemo 

        You should have these columns:


        Can you confirm that you have these?