{"id":1503,"date":"2025-09-18T11:02:43","date_gmt":"2025-09-18T09:02:43","guid":{"rendered":"https:\/\/www.flip-design.de\/?p=1503"},"modified":"2025-09-18T11:02:43","modified_gmt":"2025-09-18T09:02:43","slug":"create-svg-images-for-power-bi-by-using-chat-gpt","status":"publish","type":"post","link":"https:\/\/www.flip-design.de\/?p=1503","title":{"rendered":"Create SVG images for Power BI by using Chat GPT"},"content":{"rendered":"\n<p>Last week, a friend asked me why he could no longer create functioning SVG graphics from Chat GPT that he could use in Power BI. This surprised me a bit. I then entered a query for a graphic there, had the graphic output as an SVG, and then inserted it into Power BI. Unfortunately, this didn&#8217;t work. The problem was relatively simple; in the end, the following function was used: ENCODEURL<\/p>\n\n\n\n<p>However, this doesn&#8217;t exist in Power BI, only in Excel. Personally, I think creating SVG graphics for Power BI is great; I also use this for icons, which I then use for graphics in Visio.<\/p>\n\n\n\n<p>Here is a sample query for Chat GPT that returns such an SVG graphic, which you can then insert as a measure within Power BI.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Create an SVG icon showing a manager entering data. Also provide the SVG code that I can use within Power BI as a measure in a table. Please do not use ENCODEURL.<\/code><\/pre>\n\n\n\n<p>The following result is then returned:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Icon_Manager_DataEntry = \r\nVAR stroke = \"#2F3B44\"\r\nVAR blue   = \"#3A8DFF\"\r\nVAR svg =\r\n\"&lt;svg xmlns='http:\/\/www.w3.org\/2000\/svg' viewBox='0 0 128 128' role='img' aria-label='Manager enters data'>\r\n  &lt;g fill='none' stroke='\" &amp; stroke &amp; \"' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'>\r\n    &lt;circle cx='36' cy='28' r='12'\/>\r\n    &lt;path d='M18 52c6-8 12-12 18-12s12 4 18 12v20H18V52z'\/>\r\n  &lt;\/g>\r\n  &lt;path d='M36 40l4 8-4 8-4-8z' fill='\" &amp; blue &amp; \"'\/>\r\n  &lt;rect x='72' y='20' width='44' height='44' rx='6' fill='none' stroke='\" &amp; stroke &amp; \"' stroke-width='6'\/>\r\n  &lt;rect x='72' y='20' width='44' height='12' rx='6' fill='\" &amp; blue &amp; \"'\/>\r\n  &lt;g stroke='\" &amp; stroke &amp; \"' stroke-width='6' stroke-linecap='round'>\r\n    &lt;line x1='72' y1='44' x2='116' y2='44'\/>\r\n    &lt;line x1='72' y1='60' x2='116' y2='60'\/>\r\n    &lt;line x1='88' y1='44' x2='88' y2='64'\/>\r\n    &lt;line x1='104' y1='44' x2='104' y2='64'\/>\r\n  &lt;\/g>\r\n  &lt;line x1='50' y1='32' x2='66' y2='32' stroke='\" &amp; blue &amp; \"' stroke-width='6' stroke-linecap='round'\/>\r\n  &lt;polygon points='70,32 62,28 62,36' fill='\" &amp; blue &amp; \"'\/>\r\n&lt;\/svg>\"\r\nVAR svg_no_crlf = SUBSTITUTE(SUBSTITUTE(svg, UNICHAR(10), \"\"), UNICHAR(13), \"\")\r\nVAR svg_hash_ok = SUBSTITUTE(svg_no_crlf, \"#\", \"%23\")         -- mask hex color hashes\r\nVAR svg_sp_ok   = SUBSTITUTE(svg_hash_ok, \" \", \"%20\")          -- (optional) mask spaces\r\nRETURN \"data:image\/svg+xml;utf8,\" &amp; svg_sp_ok\r\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image.png\"><img decoding=\"async\" loading=\"lazy\" width=\"940\" height=\"978\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image.png\" alt=\"\" class=\"wp-image-1504\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image.png 940w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image-288x300.png 288w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image-768x799.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n\n\n<p>The returned code can then be inserted into Power BI:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image-2.png\"><img decoding=\"async\" loading=\"lazy\" width=\"940\" height=\"553\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image-2.png\" alt=\"\" class=\"wp-image-1506\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image-2.png 940w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image-2-300x176.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2025\/09\/image-2-768x452.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n\n\n<p>I gave a further description of this in the following blog entry:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-flip-it-de-sql-bi-and-more wp-block-embed-flip-it-de-sql-bi-and-more\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"CzJrPGxjxd\"><a href=\"https:\/\/www.flip-design.de\/?p=1463\">SVG image inside Power BI with Figma<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8222;SVG image inside Power BI with Figma&#8220; &#8212; flip-it.de :: SQL, BI and more\" src=\"https:\/\/www.flip-design.de\/?p=1463&#038;embed=true#?secret=8IN123qrEs#?secret=CzJrPGxjxd\" data-secret=\"CzJrPGxjxd\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Last week, a friend asked me why he could no longer create functioning SVG graphics from Chat GPT that he could use in Power BI. This surprised me a bit. I then entered a query for a graphic there, had &hellip; <a href=\"https:\/\/www.flip-design.de\/?p=1503\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1503"}],"collection":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1503"}],"version-history":[{"count":1,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1503\/revisions"}],"predecessor-version":[{"id":1507,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1503\/revisions\/1507"}],"wp:attachment":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}