Cant enter location variable in SVG code

hi, im trying to add location variable in following dax measure (svg code) but power bi cant recognize syntax

svg image=
image

i want to add location variable instead of 150 in above code
image

HI @anonymous150

I don’t think you can do that. Did you search the net/forum/youtube? Did you use Chapgpt and ask the question?

Do you have an example where this was used?

thanks
Keith

Hi @anonymous150

You can use UNICHAR codes to add special characters to text strings. Here’s a sample measure and a screenshot of the result:

Here’s the code for the sample measure:

SVG Image = 
VAR _location = "100"
VAR _prefix1 = "data" & UNICHAR(38) & "colon;image/svg+xml;utf8,<svg xmlns=" & UNICHAR(34) & UNICHAR(34)
VAR _prefix2 = "http://www.w3.org/2000/svg" & UNICHAR(34) & UNICHAR(34)
VAR _prefix3 = "><path d=M"
VAR _suffix = " 0 l75 200 L225 200 Z></path></svg>"
VAR _Result = _prefix1 & _prefix2 & _prefix3 & _location & _suffix

RETURN
_Result

You can adjust to suit. Hope it helps.
Greg
eDNA Forum - Compose SVG Code.pbix (15.3 KB)

sorry…i didn’t know that you could that. thanks @Greg …something new you learn everyday.