cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cymorg Regular Visitor
Regular Visitor

Re: How to use Images Stored in a SQL Server Table with Power BI

Is it possible to use images stored as binary data  - varbinary(max) - stored in SQL Server?

mjfulke Regular Visitor
Regular Visitor

Re: How to use Images Stored in a SQL Server Table with Power BI

The length of the encoded data needs to be less than 32766 characters.

Re: How to use Images Stored in a SQL Server Table with Power BI

Hi guys,

 

Does anyone ever try or know how to do it with Direct Query ?

 

I tried with import and it's works, but when it is comes to Direct Query since it needs change data type on the column, it is not allowed unless I changed it to Import.

 

Anyone know how ?

 

Thanks

 

Re: How to use Images Stored in a SQL Server Table with Power BI

 Hi, I tried same step, and count the character is 1024, but still it is display as broken image. My image is png.

 

However by look at the character length, I'm not sure whether it is correct, or somehow during convert to text it is truncated ? because quite weird that all in the same length.

 

 

cymorg Regular Visitor
Regular Visitor

Re: How to use Images Stored in a SQL Server Table with Power BI

I gave up on this because I need large/high res. images.  An alternative approach was to write the images to temp. files on disk and insert a link to these in my dataset.  Seems like PowerBI only supports small icon type images out of the box.  Ces't la vie.

mjfulke Regular Visitor
Regular Visitor

Re: How to use Images Stored in a SQL Server Table with Power BI

Sounds like the length of the datatype you're using ends at 1024.  Look at varchar(max)

Re: How to use Images Stored in a SQL Server Table with Power BI

Sorry, I copy it to Excel and use Len function, not sure why it is give me that 1024. 

But I add a Calculated Column directly in Power BI in the same table, turns out it gives me what I think the correct length.

 

Some variance of length shows, but not exceed 32677, yet it doesn't show me the image instead a broken image icon.

 

Thinking of giving up as well. 😞

Highlighted
MNeish Frequent Visitor
Frequent Visitor

Re: How to use Images Stored in a SQL Server Table with Power BI

@admin_xlsior I am not sure if you are still having this problem but what I found is I just created a Veiw within my SQL DB and used Json to convert the images from bianary to Base64Jpeg. The you would just pull the images from the view you created, but I am having a problem with the images being to large for Power BI to render them. 

 

CREATE VIEW TNIPIC_VIEW AS
SELECT BACK
FROM OPENJSON(
(
SELECT CUSTOMER_ID, BACK, CHECKED_IN
FROM (SELECT DBO.YOUR DATABASE AS BACK) T
FOR JSON AUTO
)
)WITH (BACK VARCHAR(MAX))

gabrielvigo Regular Visitor
Regular Visitor

Re: How to use Images Stored in a SQL Server Table with Power BI

Hi all!

 

I followed all the steps.

But I have issues with the images I upload (from PowerApps to SQL) with the cell phone, as a photo.

 

I uploaded some as png from the PC and those look.

JPEG images are not fully loaded.

 

Screenshot_1.png

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors