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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Unable to view image in Power BI web

Good afternoon, I have a query. I have a set of images within SharePoint, but when I want to use the url that has no termination in .jpg or .png, it is not possible to visualize within the visuals offered by Power BI. In this the visual object I use is the Simple ImagesCaptura de pantalla 2021-10-11 152127.png

1 ACCEPTED SOLUTION
HarishKM
Impactful Individual
Impactful Individual

@Syndicate_Admin 

best way to access images on a sharepoint folder for my power bi reports is using a dataflow that converts it to BASE64.

 

Setup a Dataflow to point to sharepoint image folders and convert them to BASE64 per Chris Webbs Blog.

The only difference is instead of Folder.Files you use sharepoint contents function.

Source = SharePoint.Contents("https://putYourwebsite.sharepoint.com")
 
Once the data flow is setup in the service bring the converted base64 image table into your model pbix file.
Here is my example for country flags i use in my reports

 

HarishKM_0-1634026925650.png

 

Country Flag Image Table in BASE64

 

You then need DAX statement to cocatenante BASE64 string so it can display in Matrix or Table visual.

 

Display Country Flag = 
IF(
    AND ( HASONEVALUE ( 'DimRegion'[Country] ), [_Has Sales] ),
    "data:image/jpeg;base64, " &
    CONCATENATEX(
        FILTER ('CountryFlag', 'CountryFlag'[Name] = VALUES('DimRegion'[Country])),
        'CountryFlag'[Pic],
        ,
        'CountryFlag'[Index],
        ASC)
        )

 

 

This seems to best result and least impact on model size and speed of operation.


If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.

Thanks & Regards
Harish

View solution in original post

2 REPLIES 2
HarishKM
Impactful Individual
Impactful Individual

@Syndicate_Admin 

best way to access images on a sharepoint folder for my power bi reports is using a dataflow that converts it to BASE64.

 

Setup a Dataflow to point to sharepoint image folders and convert them to BASE64 per Chris Webbs Blog.

The only difference is instead of Folder.Files you use sharepoint contents function.

Source = SharePoint.Contents("https://putYourwebsite.sharepoint.com")
 
Once the data flow is setup in the service bring the converted base64 image table into your model pbix file.
Here is my example for country flags i use in my reports

 

HarishKM_0-1634026925650.png

 

Country Flag Image Table in BASE64

 

You then need DAX statement to cocatenante BASE64 string so it can display in Matrix or Table visual.

 

Display Country Flag = 
IF(
    AND ( HASONEVALUE ( 'DimRegion'[Country] ), [_Has Sales] ),
    "data:image/jpeg;base64, " &
    CONCATENATEX(
        FILTER ('CountryFlag', 'CountryFlag'[Name] = VALUES('DimRegion'[Country])),
        'CountryFlag'[Pic],
        ,
        'CountryFlag'[Index],
        ASC)
        )

 

 

This seems to best result and least impact on model size and speed of operation.


If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.

Thanks & Regards
Harish

timg
Solution Sage
Solution Sage

Hi,

This is likely because the image is not anonymously accessible. You to be logged into sharepoint to be able to view these images. In this piece of documentation you will find more details under the "Consideration" header.

Display images in a table or matrix in a report - Power BI | Microsoft Docs

 

Regards,

 

Tim





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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors