cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
btharp
Advocate I
Advocate I

A batch-conversion tool for displaying local image in Power BI

As we all know, one of the few ways (maybe the only way) to display local images in Power BI is to convert the images to base64 code. But there is a restriction for the image size.  Displaying images which are sightly greater than 25kb, say 35kb, you will only get part of it. For those with a size greater than maybe 50kb, the image will be crashed.  The problem is, images can easily goes larger than 25kb.

 

I solve this problem by developing a tool to batch reduce the image size to lower than 25kb and then convert them to base64 code.

 

Please download the tool from this link  https://1drv.ms/u/s!Amq0yNjgQSmjsGwl9YU6DC7pTvga?e=znuENP to any directory.

 

User Guide:

1, Extract the zip file, and open the Img2Base64-en.exe  under the dist folder.

img2base.png

2, After a few seconds you will be required to enter your target directory. Copy the directory path and paste it into the above form and then click "Enter" button. Notice that you can have any types of files in the directory, such as .doc, or .xlsx, but only the .jpg, .png and .jpeg files will be converted.

Img2Base2.png 

 

3,  After a few seconds, the form will be shut-off automatically. And a b64.csv file is generated in the dist folder. This file contains only two columns, one is the name of your images, the other is the base64 codes for each image.

 

4, Import the b64.csv file into PowerBI, and now the local images are all compacted and imported to PowerBI.  Set column base64's data category to Image URL, then let's enjoy it.

Img2Base3.png

1 ACCEPTED SOLUTION
MFelix
Super User III
Super User III

Hi @btharp ,

 

Great post, believe that this coul be a good post to place on the blog.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

6 REPLIES 6
Lee_Lv
Regular Visitor

GREAT !!

I'm just looking for solution of how to display local image, you saved me lot of time.
Thank you for your sharing.

khaledalru
New Member

HELP!!

 

i cant see Img2Base64-en.exe after unzupping the zip folder, i cant only see Img2Base64-en.exe.manifest and other TOC,PYZ and another zip file.

i have found the Img2Base64-en.exe under the dist folder but after clicking it a message comes saying 

"Winwodws cannot find C:/....................Img2Base64-en.exe" make sure you typed the name correctly, and then try again" 

 

after that the Img2Base64-en.exe gets deleted by it self

can you upload a screenshot of that message?

modasher
Advocate I
Advocate I

This is awesome. This post should have more views as I see a lot of people struggling with batch conversions.

 

Thanks.

MFelix
Super User III
Super User III

Hi @btharp ,

 

Great post, believe that this coul be a good post to place on the blog.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors