<?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: Dax command for conditional highlighting in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-for-conditional-highlighting/m-p/1446460#M27114</link>
    <description>&lt;P&gt;Ah!! I knew it would be something simple. Worked like a charm, thanks so much!!&lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2020 08:34:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-21T08:34:06Z</dc:date>
    <item>
      <title>Dax command for conditional highlighting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-for-conditional-highlighting/m-p/1446066#M27109</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been following along the &lt;A href="https://www.youtube.com/watch?v=L2GnAfpsO2k&amp;amp;t=275s" target="_self"&gt;Guy in a Cube video&lt;/A&gt; to set up conditional highlighting, and I've run into a problem with my dax code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;highlighting = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var _Source = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Values (Highlight[Source])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var _tohighlight =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTEDVALUE('Trend_data'[Source])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var _Colour = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VALUES(Highlight[HTML_Colour])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var _filtered =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ISFILTERED(Highlight[Source])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var _result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TRUE,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Not ( _filtered ), "#5BAF8D",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_tohighlight in _source &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;amp;&amp;amp; _filtered,"#5BAF8D",_Colour)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm getting an error which essentially says syntax for ')' and I can't work out where I've gone wrong! Is anything obvious jumping out at anyone?&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 06:00:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-for-conditional-highlighting/m-p/1446066#M27109</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-21T06:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dax command for conditional highlighting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-for-conditional-highlighting/m-p/1446290#M27113</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are missing the RETURN part, necessary when you use variables:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;highlighting =
VAR _Source =
    VALUES ( Highlight[Source] )
VAR _tohighlight =
    SELECTEDVALUE ( 'Trend_data'[Source] )
VAR _Colour =
    VALUES ( Highlight[HTML_Colour] )
VAR _filtered =
    ISFILTERED ( Highlight[Source] )
VAR _result =
    SWITCH (
        TRUE,
        NOT ( _filtered ), "#5BAF8D",
        _tohighlight IN _Source
            &amp;amp;&amp;amp; _filtered, "#5BAF8D",
        _Colour
    )
RETURN
    _result&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 07:39:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-for-conditional-highlighting/m-p/1446290#M27113</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-10-21T07:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dax command for conditional highlighting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-for-conditional-highlighting/m-p/1446460#M27114</link>
      <description>&lt;P&gt;Ah!! I knew it would be something simple. Worked like a charm, thanks so much!!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 08:34:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-command-for-conditional-highlighting/m-p/1446460#M27114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-21T08:34:06Z</dc:date>
    </item>
  </channel>
</rss>

