Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have a table in SQL Server which has Image binary data in the below format -
0x1F8C0200B28C010064
0x1F8C0200DE720100CC
0x1F8C0200DE720100CC
0x1F8C0200B28C010064
0x1F8C0200B28C010064
0x1F8C0200B28C010064
This is just part of the hex string. I am converting this into image URL using below function -
let
BinaryToPbiImage = (BinaryContent as binary) as text=>
let
Base64 = "data:image/jpeg;base64," & Binary.ToText(BinaryContent, BinaryEncoding.Base64)
in
Base64
in
BinaryToPbiImage
Now whats happening is the image is not being displayed. Is there some change that I need to do in my code.
Any suggestion would be helpful.
Solved! Go to Solution.
Hi @Anonymous ,
Please check if the method in this blog could help you.
Step 7
Change the data type of ImageData (Binary) column to text from the top panel's Transform tab.
Step 8
Go to "Add Column" and click on "Custom Column". It will open a window. Enter the column name and formula given below and click OK.“data:image/<image_format>;base64,”&[ImageData<binary_column_name>]
Step 9
On Data tab, select Image column and change its data category to Image URL.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I didnt notice any special difference between:
let
BinaryToPbiImage = (BinaryContent as binary) as text=>
let
Base64 = "data:image/jpeg;base64, " & Binary.ToText(BinaryContent,BinaryEncoding.Base64)
in
Base64
in
BinaryToPbiImage
and:
"data:image/jpeg;base64,"&[Content]
In my table or SimpleImage viz looks all the same.
Hi @Anonymous ,
Please check if the method in this blog could help you.
Step 7
Change the data type of ImageData (Binary) column to text from the top panel's Transform tab.
Step 8
Go to "Add Column" and click on "Custom Column". It will open a window. Enter the column name and formula given below and click OK.“data:image/<image_format>;base64,”&[ImageData<binary_column_name>]
Step 9
On Data tab, select Image column and change its data category to Image URL.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@AlexisOlson There is something I noticed, when I am using the function and encoding into base64 I am getting something like this
H4wCAMU6AADNuWVQHEDXJjpA8ABJCO7ungGCBncL7u7ubiFY
Whereas if I use the same image and convert the image itself to base 64 the value is -
iVBORw0KGgoAAAANSUhEUgAAAV0AAAEOCAIAAACl8FO5AA
Yes I am using colon. When I am copying the code here its automatically converting into it ":"
Please double-check that you are actually using a colon ":" rather than ":" in your function.
I am not sure. The original image is either in jpeg or png
Yes, I do have it in binary. SQL Data column type is Image if that helps
Hmm. Is the binary a JPEG encoding? I'm just shooting in the dark.
@AlexisOlson I am referring to the same article. But its not converting.
Yes, I have set it as an Image URL. Also, does the source field needs to be binary format or text? This is what I see.
The data source should be binary, not text.
Did you set the Data Category as Image URL as explained here?
https://blog.gbrueckl.at/2018/01/storing-images-powerbi-analysis-services-data-models/
Hello there.
I was following the instructions on the presented link for the image import: https://powerbipoint.com/2024/02/05/how-to-embedding-base64-images-in-power-bi/
Now I've reached the last step which is "Creating a DAX measure to group chunks of the same image"
When I follow the instructions my measure fails and says:
Could you please help me with this situation.
I'm trying to import images from Sharepoint so I can later upload PoweBI dashboard to Junction.
Thank you in advance
User | Count |
---|---|
63 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
82 | |
62 | |
45 | |
41 | |
40 |