<?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: Calculation Group - conditional formatting in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4405842#M174922</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try rewriting your measure like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;measure_color =
VAR ChangeValue = [Count Forms Category]
VAR Result =
    IF (
        SELECTEDVALUE ( 'Calc Group'[name] ) IN { "MyCalcItem1", "MyCalcItem2" },
        SWITCH ( TRUE, ChangeValue &amp;gt; 0, "#008000", ChangeValue &amp;lt; 0, "#FF0000" )
    )
RETURN
    Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The concept is to wrap the logic in an IF statement that determines if a matrix column is one of the calculation items that needs formatting. The limitation of this approach is that you have to specify the measure name. SELECTEDMEASURE is a calculation item placeholder so it won't work in a measure. Here's a helpful video:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=MbxJ1oHHyTg" target="_self"&gt;https://www.youtube.com/watch?v=MbxJ1oHHyTg&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2025 22:41:42 GMT</pubDate>
    <dc:creator>DataInsights</dc:creator>
    <dc:date>2025-02-11T22:41:42Z</dc:date>
    <item>
      <title>Calculation Group - conditional formatting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4405400#M174885</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a matrix table with one value and a calculation group for different time periods + calculations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to put conditional formatting on the marked columns in red with + and - signs (see screenshot)&lt;/P&gt;&lt;P&gt;However, I cannot "select" (or don't know how to) those columns because they belong to a calculation group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to create a color-measure and then select with conditonal formatting (field) this measure, but it didn't work either:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;measure_color=&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;ChangeValue&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDMEASURE&lt;/SPAN&gt;&lt;SPAN&gt;() &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ChangeValue&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"#008000"&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ChangeValue&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"#FF0000"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas are highly appreciated! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 15:10:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4405400#M174885</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-02-11T15:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Group - conditional formatting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4405842#M174922</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try rewriting your measure like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;measure_color =
VAR ChangeValue = [Count Forms Category]
VAR Result =
    IF (
        SELECTEDVALUE ( 'Calc Group'[name] ) IN { "MyCalcItem1", "MyCalcItem2" },
        SWITCH ( TRUE, ChangeValue &amp;gt; 0, "#008000", ChangeValue &amp;lt; 0, "#FF0000" )
    )
RETURN
    Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The concept is to wrap the logic in an IF statement that determines if a matrix column is one of the calculation items that needs formatting. The limitation of this approach is that you have to specify the measure name. SELECTEDMEASURE is a calculation item placeholder so it won't work in a measure. Here's a helpful video:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=MbxJ1oHHyTg" target="_self"&gt;https://www.youtube.com/watch?v=MbxJ1oHHyTg&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 22:41:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4405842#M174922</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2025-02-11T22:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Group - conditional formatting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4406658#M174950</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="207275" data-lia-user-login="DataInsights" class="lia-mention lia-mention-user"&gt;DataInsights&lt;/a&gt;&amp;nbsp; Thank you very much - also for the Video, awesome stuff! ^^&lt;BR /&gt;&lt;BR /&gt;I put in the following measure and it worked fine:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;One &lt;/SPAN&gt;&lt;SPAN&gt;Measure&lt;/SPAN&gt;&lt;SPAN&gt; Cond Format =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'CalcGroup'&lt;/SPAN&gt;&lt;SPAN&gt;[Name]&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;SPAN&gt;"Δ LY"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Δ LY in %"&lt;/SPAN&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Count Forms Category]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Feb 2025 09:23:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4406658#M174950</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-02-12T09:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Group - conditional formatting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4407519#M175001</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to hear it worked!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 18:21:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-Group-conditional-formatting/m-p/4407519#M175001</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2025-02-12T18:21:38Z</dc:date>
    </item>
  </channel>
</rss>

