Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I've created a measure that returns SVG code that loads bitmap images from a web-server to include them in the SVG image. I know the SVG code is correct, because it shows the correct image in the "HTML Content" custom visual. But when using Power BI built in visuals, it doesn't load the images. They appear broken.
Does anyone know a way to fix this, e.g., by storing the files in a specific, allowed location, e.g., a SharePoint in the same tenant, crafting a specific URL or something? Embedding the base64 encoded bitmap images into the measure wasn't an option because the string length exceeds the buffer length so it doesn't work.
This is the measure code:
"data:image/svg+xml;utf8," &
"<svg width='388' height='325' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<image x='0' y='240' width='38' height='325' xlink:href='https://github.com/MartinBubenheimer/powerbi-solutions/blob/main/svg/assets/Stick.png?raw=true' />
<image x='70' y='210' width='38' height='325' xlink:href='https://github.com/MartinBubenheimer/powerbi-solutions/blob/main/svg/assets/Stick.png?raw=true' />
<image x='140' y='140' width='38' height='325' xlink:href='https://github.com/MartinBubenheimer/powerbi-solutions/blob/main/svg/assets/Stick.png?raw=true' />
<image x='210' y='90' width='38' height='325' xlink:href='https://github.com/MartinBubenheimer/powerbi-solutions/blob/main/svg/assets/Stick.png?raw=true' />
<image x='280' y='110' width='38' height='325' xlink:href='https://github.com/MartinBubenheimer/powerbi-solutions/blob/main/svg/assets/Stick.png?raw=true' />
<image x='350' y='4' width='38' height='321' xlink:href='https://github.com/MartinBubenheimer/powerbi-solutions/blob/main/svg/assets/Cracker.png?raw=true' />
</svg>"
And this is the result in a new card visual:
It shows four broken images, that's not your browser 😉
Kind regards,
Martin
Solved! Go to Solution.
Well, you know the spiel - If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com
Or you could treat it as a bug - If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .
I think it's a feature 😉 As long as nobody locks me out of the HTML Content custom visual I'll try to stick to this workaround.
Inline the images as Base64 strings. Split the strings into pieces smaller than 32K and then put them back together in the measure.
https://blog.crossjoin.co.uk/2019/05/19/storing-large-images-in-power-bi-datasets/
You will need to use a link to the actual raw file.
You can also try to inline these into the SVG
Does SVG support embedding of bitmap images? - Stack Overflow
But that may also not work with the built-in visuals.
Hi @lbendlin ,
Thank you for looking into this issue. I should have mentioned that my semantic model uses calculation groups. All you described works in models without calculation groups, but as mentioned in the comments of your referenced article, your solution is not compatible with calculation groups in the same semantic model (same as default auto aggregations, but as Microsoft users we tend to call such behaviour "feature", don't we? 😉). Or, more precise, the original idea of Chris Webb was to overcome a limit of how much text you can load into one text field in the database, not to overcome a limit in DAX measures. With calculation groups in the same model, the text limit for a measure is the same as the text limit for a text field in the database, so it becomes obsolete in this case. See: Chris Webb's BI Blog: Storing Large Images In Power BI Datasets
That's why I was rather following the URL linked image approach rather than the URL embedded image approach. Any idea whether this could work under specific constraints or circumstances?
Kind regards,
Martin
Update: Power BI can access the image files and accepts them if I create a measure only containing the URL of one image. Then the image appears, e.g., in a Matrix visual. It only does not appear when the link is used inside of the SVG code.
When embedding an image (that is small enough) in the SVG code, it also shows up correctly.
So the following works:
Now what is missing is the combination:
Without further ado such images appear as broken.
Well, you know the spiel - If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com
Or you could treat it as a bug - If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
21 | |
20 | |
19 | |
13 | |
12 |
User | Count |
---|---|
41 | |
27 | |
23 | |
22 | |
22 |