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

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

Reply
Anonymous
Not applicable

How to scale the SVG image in matrix?

Hi! I'd be thankful for any help.

 

So I need to put my rectangular SVG image into my matrix as a column. For simplicity I have an example with the red rectangular. I use the following formula:

Example =
VAR MyText =
"data&colon;image/svg+xml;utf8, <svg width=""200"" height=""100"" viewBox=""0 0 100 100"" xmlns=""http://www.w3.org/2000/svg"" style=""background: red"">
</svg>"
RETURN MyText
 
And the result is the following
 

 

How can I force my red figure to scale and fill all the cell, which is of dark grey colour at the picture (at least by either height or width)? I tried to change parameters in my code or to play with Grid-Image height, but it didn't help. I cannot avoid those terrible gaps between rows while changing image height or a lot of free space inside my cell. Also I cannot get the logic behind its visual changing/not changing while I'm changing parameters in my code.
 
What am I doing wrong? Any tips here? 
 
 
3 REPLIES 3
Anonymous
Not applicable

example1.jpg

Hi @Anonymous,

SVG support within tables is a bit lacking. You only have control over a single apsect of the dimension for the container itself, which is specified in the properties under Grid Image Height. This will specify both the height and width of the containing div that the SVG gets rendered into, e.g.:

svg_scaling.gif

The GIF is a bit skippy but hopefully you can see that the cell pretty much remains square throughout.

The way to solve it is that we need a property to allow control of the image width as well as the height. There's an idea here for this feature, if you want to vote on it (I just did).

Not the answer you were after, I'm sure but hopefully clarifies what's possible right now.

Regards,

Daniel


If my post solves your challenge, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Anonymous
Not applicable

hi, Daniel! Thank you for the answer. It's so strange and abnormal, that some basic bugs are not being fixed for years, but more and more highly specialized features are added. Ugh, I'm so angry... How can I make a normal visualization, if I even have no option for vertical allignment inside matrix cell??!!... Some simple excel features are still absent... And this small bugs as the result destroy all the work I made for designing my report, cause my final user doesn't see my dax and table schemas, but asks to eliminate those gaps between rows... 

 

Dear Power Bi, facing such issues several times per day is so... disappointing. And I'm not the first person leaving such a comment, you know. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors