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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
christinamarie
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

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
v-lili6-msft
Community Support
Community Support

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.

@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. 😞

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. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.