Forum Discussion
Anonymous
3 years agoNot applicable
SVG Dax not working
I have written this dax in order to get arrows up and down and horizontal depending on condions, but it's not working:
M6a_ =
Switch(
True(),
([KPI_6a] > [LM 6a]),
"data:image/svg+xml;utf8,
<svg xmlns='svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25"><path style="fill:#232326" d="m18.294 16.793-5.293 5.293V1h-1v21.086l-5.295-5.294-.707.707L12.501 24l6.5-6.5-.707-.707z'/></svg>",
([KPI_6a] < [LM 6a]),
<svg data-name="1-Arrow Up" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="m26.71 10.29-10-10a1 1 0 0 0-1.41 0l-10 10 1.41 1.41L15 3.41V32h2V3.41l8.29 8.29z"/></svg>
<svg data-name="1-Arrow Up" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="m26.71 10.29-10-10a1 1 0 0 0-1.41 0l-10 10 1.41 1.41L15 3.41V32h2V3.41l8.29 8.29z"/></svg>,
"data:image/svg+xml;utf8,
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m21.706 12.708-3 3a1 1 0 0 1-1.414-1.414L18.586 13H5.414l1.293 1.293a1 1 0 1 1-1.414 1.414l-3-3a1 1 0 0 1 0-1.416l3-3a1 1 0 0 1 1.414 1.416L5.414 11h13.172l-1.293-1.293a1 1 0 0 1 1.414-1.414l3 3a1 1 0 0 1-.001 1.415z" style="fill:#1c1b1e" data-name="Expand Direction"/></svg>"
)
Anonymous Set the Data catagory to Image URL
4 Replies
- Greg_Deckler
Community Champion
Anonymous You need to use single quotes inside the double quotes. See examples here:
(1) SVG Animation - Bouncing/Blinking Stephen Few 'Red... - Microsoft Fabric Community
- AnonymousNot applicable
Thank you. I no longer have error on the measure, but I am unable to use the measure in the matrix, as it keeps showing the code.
- Greg_Deckler
Community Champion
Anonymous Set the Data catagory to Image URL