cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmattar
Frequent Visitor

Base64 Images

Hello,

 

I have searched endlessly for this solution and every thread seems to go into a dead end. 

 

I would like to know how to show images that are already encoded in Base64. I have a PowerApp that can take pictures and stores the image data(format) in a SP list. The results from the PowerApp to the SP list for an image are "data:image/jpeg;base64,/.... I am using PowerBi desktop and my images do not display. Can anyone help ? pbi3.PNGpbi4.PNG

Thanks !

2 ACCEPTED SOLUTIONS

Hi @mmattar ,

Actually, PowerBI has a limitation in the size of Base64 column, but I haven't found a document describing this. Besides, we can't find a method to reduce the size of Base64, you can consider reduce the quality of image and convert it to Base64 again.

As a workaround, we can upload the image to server, then use the image url to display it.

Best Regards,

Teige

View solution in original post

Hi @mmattar ,

Some Online storage provider like Azure or Onedrive can provide the web url for a picture, https://www.fourmoo.com/2017/09/26/power-bi-using-onedrive-to-embed-and-host-images-for-power-bi/

Best Regards,

Teige

View solution in original post

13 REPLIES 13
Vladisam
Helper II
Helper II
muna7554
New Member

Hi ,

 

You can do in power BI but their is limitation

Add you r convert column image base64code

And In Power BI  Desktop Model.Data,andDesign tab click the Data tab abd change the image base64code column  Data catogert as Image URL after that take one grod and add the image base64code column , limitation is image size big image cant display

mmattar
Frequent Visitor

I read that if the encoded Base64 column reaches max limit that the image does not show in full, this just happened to me, i see the image but its cut off. anyway to shorten the Base64 format to view the whole image ? 

Hi @mmattar ,

Actually, PowerBI has a limitation in the size of Base64 column, but I haven't found a document describing this. Besides, we can't find a method to reduce the size of Base64, you can consider reduce the quality of image and convert it to Base64 again.

As a workaround, we can upload the image to server, then use the image url to display it.

Best Regards,

Teige

mmattar
Frequent Visitor

Hi @TeigeGao , can you elborate a bit more on "we can upload the image to server, then use the image url to display it" 

Thanks

Hi @mmattar ,

Some Online storage provider like Azure or Onedrive can provide the web url for a picture, https://www.fourmoo.com/2017/09/26/power-bi-using-onedrive-to-embed-and-host-images-for-power-bi/

Best Regards,

Teige

How would I do something like this programmatically through Power BI's power query editor for a OneDrive Folder?

 

Currently, I created a custom column to convert the image to Base64, and ran into the clipping issue mentioned above, and I created a custom column that concatinated the file name and folder path and applied the picutre url category to it, but to no avail. So short of going into the image folder and manually resizing each image one by one, and testing until unclipped, I'm not sure if there's a way to auto generate the embedded url for each image. I'm all about saving time haha.

I am using simple PowerApp (really, document library and specifically pdf viewer) as a visual in PowerBI to display base64 stored on Sharepoint. I am passing document ID from PowerBI to PowerApp visual, and document is displayed in PBI

I used this video:
https://www.youtube.com/watch?v=GFfAkk3g1y8

I just viewed that video, it looks promising but its connecting to Power App, so to make sure I got the concept generally correct, the unlimited character base64 would fully populate in Power BI without needing to break up the base64 images into chunks, and without having to do resizing tomfoolery with the images before converting to base64 and storing as a link in PBI?

 

Also, how did you get the connection to PBI? Was it from the Power App or directly from sharepoint?

Sharepoint does not have limitation of 32k characters, not sure if this is an issue for you too or just for initiator of the thread (base64 there was on Sharepoint). PowerApp also does not have this limitation. I have a table in PBI which maps SP list ID to the document, and this is what I pass to from PBI to PowerApp. Gallery in PowerApp has SP list as a source, and ThisItem is constructed using input from PBI to get path to the item you want to see.
You build PowerApp launching it from PBI (i.e you add visual, drag fields you need, and this will start the process, and you add SP as a source to PA). Both PBI and PApp need access to SP.

mmattar
Frequent Visitor

the character limit for a string is 32,766, anyways of reducing ? 

I believe so. Now if only I can get my image sizes standardized so base64 will always fit in the column.

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors