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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
pmartin28
Frequent Visitor

Problem loading SQL database with image column

Hello,

 

I'm having problems importing a SQL query. I've already imported this database before without problems, but now when I navigate to that SQL table, this error appears:

"Explicit conversion from data type image to nvarchar(max) is not allowed

 

Details:

DataSourceKind=SQL

DataSourcePath=XXXXXX

Message=Explicit conversion from data type image to nvarchar(max) is not allowed.

ErrorCode=2146232060

Number=529

Class=16".

 

I have not done any transformation of that data column, I've only connected Power BI to that table. In this table there is a type "image" column. If I create a SQL view without this column, the query connects succesful. But I need this column and to be able to connect correctly to all the SQL tables, regardless of the type of columns there are (I didn't have any problems before).

 

Thanks a lot,

Best regards.

 

Captura de pantalla 2023-09-26 110205.png

5 REPLIES 5
lbendlin
Super User
Super User

But I need this column 

what are you planning to do with it?

I need to put this image in a tooltip. Anyway, if I connect the same SQL table to Power Query in Excel, the error doesn't appears, the connection is succesful. I don't understand why Power BI doesn't do the query as the same way.

 

Thanks.

In Power BI you need to Base64 encode your image data.

 

https://blog.crossjoin.co.uk/2019/05/19/storing-large-images-in-power-bi-datasets/

Okay, I'll look into it. Anyway, the issue is that before, I connected to that database table and in the image field I would see 'Binary' and could work with the query. Now, it gives an error in the preview and I can't work with the table. I have to make the connection in Power Query for Excel, remove the 'Image' column, copy the advanced query code, and paste it into Power BI. I didn't have to do all this before.

Please qualify "before" - did it work earlier, or did it work elsewhere?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.