<?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 Re: Fancy animated svg bar through DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335715#M172160</link>
    <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2024 21:58:40 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-12-18T21:58:40Z</dc:date>
    <item>
      <title>Fancy animated svg bar through DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335011#M172119</link>
      <description>&lt;P&gt;Hi all. I'm trying to use DAX to build a fun animated bar chart to be used in a table. The goal is to add a bar to each line in the table that changes colour based on if the pipeline is greater or smaller than the target for each item in the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've already successfully made the bar to be sized correctly depending on how much ahead of target or behind the item is. The bar also changes colour to a yellow gradient if behind target, and blue gradient for every item ahead of target. So far all good.&lt;/P&gt;&lt;P&gt;My challenge now is to make sure that the "Total" line does not show the SVG rendered animation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips on how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current DAX&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SVG PBO vs Target = 
VAR SVGWidth = 100
VAR SVGHeight = 12

VAR _PipelineMin = MINX( ALLSELECTED( Accounts[Customer ID] ) , [Pipeline($)] )
VAR _TargetMin = MINX( ALLSELECTED( Accounts[Customer ID] ) , [Target ($)] )
VAR _PipelineMax = MAXX( ALLSELECTED( Accounts[Customer ID] ) , [Pipeline ($)] )
VAR _TargetMax = MAXX( ALLSELECTED( Accounts[Customer ID] ) , [Target ($)] )

VAR _RangeMin = MIN( _PipelineMin , _TargetMin )
VAR _RangeMax = MAX( _PipelineMax , _TargetMax ) *1.2 //Adds a little extra space)
VAR PipelineBarWidth = ( DIVIDE( [Pipeline ($)] - _RangeMin , _RangeMax - _RangeMin ) ) * SVGWidth
VAR TargetBarWidth = ( DIVIDE( [Target ($)] - _RangeMin , _RangeMax - _RangeMin ) ) * SVGWidth

VAR Definitions = 
  "&amp;lt;defs&amp;gt;
    &amp;lt;linearGradient x1='-61.5225' y1='108.592' x2='148.402' y2='227.408' gradientUnits='userSpaceOnUse' spreadMethod='reflect' id='fill0'&amp;gt;
      &amp;lt;stop offset='0' stop-color='#E6AD10' /&amp;gt;
      &amp;lt;stop offset='0.5' stop-color='#D7950F' /&amp;gt;
      &amp;lt;stop offset='1' stop-color='#C87E0E' /&amp;gt;
    &amp;lt;/linearGradient&amp;gt;
    &amp;lt;linearGradient x1='43.5' y1='241.719' x2='43.5' y2='-1.71875' gradientUnits='userSpaceOnUse' spreadMethod='reflect' id='stroke1'&amp;gt;
      &amp;lt;stop offset='0' stop-color='#50E6FF' stop-opacity='0' /&amp;gt;
      &amp;lt;stop offset='1' stop-color='#50E6FF' /&amp;gt;
    &amp;lt;/linearGradient&amp;gt;
    &amp;lt;linearGradient x1='-33.3955' y1='147.875' x2='120.395' y2='92.1256' gradientUnits='userSpaceOnUse' spreadMethod='reflect' id='fill2'&amp;gt;
      &amp;lt;stop offset='0' stop-color='#3CCBF4' /&amp;gt;
      &amp;lt;stop offset='0.25' stop-color='#219AD8' /&amp;gt;
      &amp;lt;stop offset='0.75' stop-color='#086CBE' /&amp;gt;
      &amp;lt;stop offset='0.91' stop-color='#0669BC' /&amp;gt;
      &amp;lt;stop offset='1' stop-color='#0669BC' /&amp;gt;
    &amp;lt;/linearGradient&amp;gt;
  &amp;lt;/defs&amp;gt;"

VAR TargetBarAnimation = 
"&amp;lt;animate attributeName='width' from='0' to='"&amp;amp; TargetBarWidth &amp;amp;"' dur='2s' fill='freeze' /&amp;gt;"

VAR PipelineBarAnimation = 
"&amp;lt;animate attributeName='width' from='0' to='"&amp;amp; PipelineBarWidth &amp;amp;"' dur='2s' fill='freeze' /&amp;gt;"

VAR TargetBar = 
"&amp;lt;rect x='0' y='0' width='"&amp;amp; TargetBarWidth &amp;amp;"' height='"&amp;amp; SVGHeight &amp;amp;"' fill='url(#fill0)' rx='5' ry='5'&amp;gt;
    "&amp;amp; TargetBarAnimation &amp;amp;"
&amp;lt;/rect&amp;gt;"

VAR PipelineBar = 
"&amp;lt;rect x='0' y='0' width='"&amp;amp; PipelineBarWidth &amp;amp;"' height='"&amp;amp; SVGHeight &amp;amp;"' fill='url(#fill2)' rx='5' ry='5'&amp;gt;
    "&amp;amp; PipelineBarAnimation &amp;amp;"
&amp;lt;/rect&amp;gt;"

VAR Img =
    "
    data&amp;amp;colon;image/svg+xml;utf8, &amp;lt;svg width='"&amp;amp; SVGWidth &amp;amp;"' height='"&amp;amp; SVGHeight &amp;amp;"' xmlns='http://www.w3.org/2000/svg'&amp;gt;
    "&amp;amp; Definitions &amp;amp;
    TargetBar &amp;amp;  // Draw target bar first
    PipelineBar &amp;amp;   // Draw pipeline bar in front
    "&amp;lt;/svg&amp;gt;
    "
RETURN
IF(
    NOT ISBLANK( [Target ($)] ),
    Img
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 11:58:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335011#M172119</guid>
      <dc:creator>lokrheim</dc:creator>
      <dc:date>2024-12-18T11:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fancy animated svg bar through DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335138#M172127</link>
      <description>&lt;P&gt;Use ISINSCOPE or HASONEVALUE&amp;nbsp; to restrict the output to when you are in the rows, not in the totals.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 13:31:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335138#M172127</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-18T13:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Fancy animated svg bar through DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335653#M172156</link>
      <description>&lt;P&gt;How would you incorporate that?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 20:31:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335653#M172156</guid>
      <dc:creator>lokrheim</dc:creator>
      <dc:date>2024-12-18T20:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fancy animated svg bar through DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335715#M172160</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 21:58:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Fancy-animated-svg-bar-through-DAX/m-p/4335715#M172160</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-18T21:58:40Z</dc:date>
    </item>
  </channel>
</rss>

