cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
christinamarie Frequent Visitor
Frequent Visitor

Using local images in matrix column -- String Larger than Page Size

I'm trying to use images as the "column names" in a table, where instead of the column name, at the top of each column is the image instead of a text name. As recent as a few months ago, I was able to do this by importing the images using the "Folder" source, and then converting the images to local URLs using the following custom function, and then dragging the URL field to the "column" section of the matrix visual: 

 

let
    BinaryToPbiImage = (BinaryContent as binary) as text=>
let
    Base64 = "data:image/jpeg;base64, " & Binary.ToText(BinaryContent, BinaryEncoding.Base64)
in
    Base64 
in
    BinaryToPbiImage

Today when I tried to do the same thing, the pictures appeared in the matrix columns as normal, but when I tried to order the pictures alphabetically by name, I got a "Can't display the visual" error. When I clicked for more details, it said "Memory error: While attempting to store a string, a string was found that was larger than the page size selected. The operation cannot be completed."

 

Does anyone know how to fix this? Any help on this would be incredibly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
christinamarie Frequent Visitor
Frequent Visitor

Re: Using local images in matrix column -- String Larger than Page Size

Update: I tried the function on other pictures and it seemed to work as expected. I noticed that the .jpegs that it worked with were much smaller than the pictures that it didn't work with, so I got the pictures under about 20 kb each and it's now working perfectly! I guess the length of the URL string is directly correlated with how big the file is. 

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Using local images in matrix column -- String Larger than Page Size

hi, @christinamarie 

When you try to order the pictures alphabetically by name, if you could try to use the Sort by Column button

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column#sort-using-the-sort-by-column-butto...

Add a rank column for this picture column, then sort by column not sort it directly.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
christinamarie Frequent Visitor
Frequent Visitor

Re: Using local images in matrix column -- String Larger than Page Size

@v-lili6-msft  Sorry, to be clear, I was using the Sort by Column. Each picture has a name "Tommy.jpeg", "Lisa.jpeg", and also has the local URL column called BinarytoPbiImage, which I've placed in the "Column" field of the matrix visual. Whenever I try ordering BinarytoPbiImage by name, I get the error. I attempted what you said and tried using an Index column (numbered it in alphabetical order starting from one) but I ended up getting the same error. 😞

christinamarie Frequent Visitor
Frequent Visitor

Re: Using local images in matrix column -- String Larger than Page Size

Update: I tried the function on other pictures and it seemed to work as expected. I noticed that the .jpegs that it worked with were much smaller than the pictures that it didn't work with, so I got the pictures under about 20 kb each and it's now working perfectly! I guess the length of the URL string is directly correlated with how big the file is. 

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 52 members 1,151 guests
Please welcome our newest community members: