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
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
Super User

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?

Anonymous
Not applicable

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

 

Thanks.

MFelix
Super User
Super User

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



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