<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Simple SVG KPI (Power BI august 2018 update) in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/485505#M183</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;based on the last update Power BI video of SVG visualisation here is a measure, that creates simple KPI.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;User has to add reference&amp;nbsp;for 3 values: Main Value, Goal and Max Value.&lt;/P&gt;
&lt;P&gt;Based on values KPI color is&amp;nbsp;changing to green or red. User can also change colors or edit if function for color changing.&lt;/P&gt;
&lt;P&gt;Measure category has to be Image URL.&lt;/P&gt;
&lt;P&gt;Visualisation only works in table visual. I hope&amp;nbsp;someday will works in other visualisations too.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe there is a change to get a simple visualisation, where DAX measure could return HTML code for creating custom visuals.&lt;/P&gt;
&lt;P&gt;If you like measure, please use it and improve it. Please share your versions of measure.&lt;/P&gt;
&lt;P&gt;Code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;SVG KPI = 
------------------------DATA (replace values)-------------------------
VAR MainValue = 'Value'[Measure] 
VAR GoalValue = 'Goal'[Goal Value]
VAR MaxValue = 'Max Value'[MaxValue] //End value of bar must be higher than value and goal
VAR GoalTxt = "Goal"
-----------------------COLORS--------------------
VAR ColorGood= "Green"
VAR ColorBad ="Red"
VAR GoalColor = "Orange"
----------------IF statement for colors------------------------------------------
VAR KPIColor = if(GoalValue&amp;lt;=MainValue;ColorGood;ColorBad)
---------------------------------------
VAR ValuePos = MainValue/MaxValue*100
VAR GoalPos = GoalValue/MaxValue*100
VAR PicHigh = "150"
VAR PicWidth ="150"
------------------- SVG code
VAR SvgC = 
"
&amp;lt;text x='0' y='25' font-size='35' fill='"&amp;amp;KPIColor&amp;amp;"'&amp;gt;"&amp;amp;MainValue&amp;amp;"&amp;lt;/text&amp;gt;
&amp;lt;text x='0' y='55' font-size='25' fill='Orange'&amp;gt;"&amp;amp;GoalTxt&amp;amp;" "&amp;amp;GoalValue&amp;amp;"&amp;lt;/text&amp;gt;
&amp;lt;rect x='0' y='70' rx='0,5' ry='20' width='100%' height='25'
  style='fill:white;stroke:black' /&amp;gt;
&amp;lt;rect x='0' y='70' rx='0,5' ry='20' width='"&amp;amp;ValuePos&amp;amp;"%' height='25'
  style='fill:"&amp;amp;KPIColor&amp;amp;";stroke:black' /&amp;gt;
&amp;lt;line x1='"&amp;amp;GoalPos&amp;amp;"%' y1='65' x2='"&amp;amp;GoalPos&amp;amp;"%' y2='200' style='stroke:"&amp;amp;GoalColor&amp;amp;";stroke-width:3' /&amp;gt;
"
------------SVG - start code &amp;amp; end code
VAR Cd1=
"data&amp;amp;colon;image/svg+xml;charset=utf-8," &amp;amp;
"&amp;lt;svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px'
    width='"&amp;amp;PicWidth&amp;amp;"' 
    height='"&amp;amp;PicHigh&amp;amp;"' 
     viewBox = '0 0 100 100'&amp;gt; "
VAR Cd2 = " &amp;lt;/svg&amp;gt;"
RETURN
Cd1&amp;amp;SvgC&amp;amp;Cd2
 &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 16:14:22 GMT</pubDate>
    <dc:creator>matemusic</dc:creator>
    <dc:date>2018-08-09T16:14:22Z</dc:date>
    <item>
      <title>Simple SVG KPI (Power BI august 2018 update)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/485505#M183</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;based on the last update Power BI video of SVG visualisation here is a measure, that creates simple KPI.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;User has to add reference&amp;nbsp;for 3 values: Main Value, Goal and Max Value.&lt;/P&gt;
&lt;P&gt;Based on values KPI color is&amp;nbsp;changing to green or red. User can also change colors or edit if function for color changing.&lt;/P&gt;
&lt;P&gt;Measure category has to be Image URL.&lt;/P&gt;
&lt;P&gt;Visualisation only works in table visual. I hope&amp;nbsp;someday will works in other visualisations too.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe there is a change to get a simple visualisation, where DAX measure could return HTML code for creating custom visuals.&lt;/P&gt;
&lt;P&gt;If you like measure, please use it and improve it. Please share your versions of measure.&lt;/P&gt;
&lt;P&gt;Code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;SVG KPI = 
------------------------DATA (replace values)-------------------------
VAR MainValue = 'Value'[Measure] 
VAR GoalValue = 'Goal'[Goal Value]
VAR MaxValue = 'Max Value'[MaxValue] //End value of bar must be higher than value and goal
VAR GoalTxt = "Goal"
-----------------------COLORS--------------------
VAR ColorGood= "Green"
VAR ColorBad ="Red"
VAR GoalColor = "Orange"
----------------IF statement for colors------------------------------------------
VAR KPIColor = if(GoalValue&amp;lt;=MainValue;ColorGood;ColorBad)
---------------------------------------
VAR ValuePos = MainValue/MaxValue*100
VAR GoalPos = GoalValue/MaxValue*100
VAR PicHigh = "150"
VAR PicWidth ="150"
------------------- SVG code
VAR SvgC = 
"
&amp;lt;text x='0' y='25' font-size='35' fill='"&amp;amp;KPIColor&amp;amp;"'&amp;gt;"&amp;amp;MainValue&amp;amp;"&amp;lt;/text&amp;gt;
&amp;lt;text x='0' y='55' font-size='25' fill='Orange'&amp;gt;"&amp;amp;GoalTxt&amp;amp;" "&amp;amp;GoalValue&amp;amp;"&amp;lt;/text&amp;gt;
&amp;lt;rect x='0' y='70' rx='0,5' ry='20' width='100%' height='25'
  style='fill:white;stroke:black' /&amp;gt;
&amp;lt;rect x='0' y='70' rx='0,5' ry='20' width='"&amp;amp;ValuePos&amp;amp;"%' height='25'
  style='fill:"&amp;amp;KPIColor&amp;amp;";stroke:black' /&amp;gt;
&amp;lt;line x1='"&amp;amp;GoalPos&amp;amp;"%' y1='65' x2='"&amp;amp;GoalPos&amp;amp;"%' y2='200' style='stroke:"&amp;amp;GoalColor&amp;amp;";stroke-width:3' /&amp;gt;
"
------------SVG - start code &amp;amp; end code
VAR Cd1=
"data&amp;amp;colon;image/svg+xml;charset=utf-8," &amp;amp;
"&amp;lt;svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px'
    width='"&amp;amp;PicWidth&amp;amp;"' 
    height='"&amp;amp;PicHigh&amp;amp;"' 
     viewBox = '0 0 100 100'&amp;gt; "
VAR Cd2 = " &amp;lt;/svg&amp;gt;"
RETURN
Cd1&amp;amp;SvgC&amp;amp;Cd2
 &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 16:14:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/485505#M183</guid>
      <dc:creator>matemusic</dc:creator>
      <dc:date>2018-08-09T16:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SVG KPI (Power BI august 2018 update)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/1678433#M668</link>
      <description>&lt;P&gt;That's really cool! I was not aware we can (prototype) Custom Visual Development like this. Great to quickly create a custom visual!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 05:34:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/1678433#M668</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2021-02-20T05:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SVG KPI (Power BI august 2018 update)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/2079812#M767</link>
      <description>&lt;P&gt;Hi, I just tried your code.&amp;nbsp;&lt;BR /&gt;I get a broken image when I use it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know if this still works? or is there are a better way to get this visual? Tried some different custom visuals, but I think they are a bit slow.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 09:23:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/2079812#M767</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-16T09:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SVG KPI (Power BI august 2018 update)</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/2409842#M825</link>
      <description>&lt;P&gt;awesome, thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 14:41:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Simple-SVG-KPI-Power-BI-august-2018-update/m-p/2409842#M825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-22T14:41:16Z</dc:date>
    </item>
  </channel>
</rss>

