Forum Discussion
JPG Cropped
When I get JPG in POwer BI destktop and add in to a table, the image is cropped, I use Base64 for convert the URL. How can I fix this trouble???
Hi,
The cropping is caused by the "Image scaling" property, not by Base64 itself.
- Select your table/matrix visual.
- Go to Format your visual (paint roller icon) → Cell elements.
- Find the image field you added → there's a property called "Image scaling" (in newer Power BI Desktop it may appear as Image fit).
- It has two options:
Fill (default) → stretches/crops the image to fill the cell completely, this is what's cutting off your images.
Fit → keeps the full image visible within the cell, preserving aspect ratio (may leave empty space).
- Switch it to Fit.
Second thing to check is row height vs column width ratio:
Even with "Fit," if your cell's width/height ratio is very different from your image's aspect ratio, the image will look squeezed or the visible area will be small. Adjust:
Row height (Format → Grid or Cell elements → Row height)
Column width (drag manually in the visual)
so the cell ratio roughly matches your image ratio (exemple: 1:1 for square logos, 16:9 for landscape photos).
4 Replies
- oussamahaimoudMemorable Member
Hi,
The cropping is caused by the "Image scaling" property, not by Base64 itself.
- Select your table/matrix visual.
- Go to Format your visual (paint roller icon) → Cell elements.
- Find the image field you added → there's a property called "Image scaling" (in newer Power BI Desktop it may appear as Image fit).
- It has two options:
Fill (default) → stretches/crops the image to fill the cell completely, this is what's cutting off your images.
Fit → keeps the full image visible within the cell, preserving aspect ratio (may leave empty space).
- Switch it to Fit.
Second thing to check is row height vs column width ratio:
Even with "Fit," if your cell's width/height ratio is very different from your image's aspect ratio, the image will look squeezed or the visible area will be small. Adjust:
Row height (Format → Grid or Cell elements → Row height)
Column width (drag manually in the visual)
so the cell ratio roughly matches your image ratio (exemple: 1:1 for square logos, 16:9 for landscape photos).
- v-kathullacCommunity Support
Thankyou oussamahaimoud for Addressing the issue.
Hi AlexOLYazaki202 ,Thank you for reaching out to Microsoft Fabric Community Forum,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the superuser for the issue worked? or Let us know if you need any further assistance?
Regards,Chaithanya
- Prince0011Solution Sage
Hi,
If you're displaying Base64-encoded JPG images in a Power BI Table visual and they're being cropped, it's usually due to a limitation of the visual rather than the Base64 conversion itself.
Here are a few things to try:
Ensure the column's Data Category is set to Image URL (even when using a Base64 data URI, such as data:image/jpeg;base64,...).
Increase the Row padding and Image height (if available) in the table formatting options.
Check whether the source images have inconsistent aspect ratios. Images with different dimensions are more likely to appear cropped.
If preserving the full image is important, consider using a Table visual instead of a Matrix (or vice versa) to see if the rendering differs.
If possible, use a custom visual that supports Fit or Contain image scaling rather than Fill, which can crop images.
Could you also clarify:
Are you using a Table or Matrix visual?
Are your images stored as data:image/jpeg;base64,... strings or generated another way?
Is every image cropped, or only images with certain dimensions?
If you can share a sample Base64 string (or a screenshot of the issue), it will be easier to determine whether the problem is with the image format or a limitation of the visual.
You may also find these resources helpful:
Power BI documentation on Image URL data category: https://learn.microsoft.com/power-bi/create-reports/power-bi-images-tables
Community discussions on displaying Base64 images in Power BI: https://community.fabric.microsoft.com/
If you found this reply helpful, please consider giving it a Kudos. If it helps resolve your issue, marking it as the Accepted Solution will help others facing the same problem.
- v-kathullacCommunity Support
Thankyou @oussamahaimoud for Addressing the issue.
Hi @AlexOLYazaki202 ,Thank you for reaching out to Microsoft Fabric Community Forum,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the superuser for the issue worked? or Let us know if you need any further assistance?
Regards,Chaithanya