<?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 Conditional formating using a Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formating-using-a-Measure/m-p/3441513#M130747</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a measure to be used in a Matrix usinf the bellow code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Measure 2 = IF (
    ISINSCOPE('Table[nm_mdld]),
        VAR indx = DIVIDE(SUM('Table'[vl_pe]), sum('Table'[vl_pvs]), 1)-1
        VAR grade = SWITCH(TRUE, indx &amp;lt;= 0.01, "1",
                                indx &amp;gt; 0.01 &amp;amp;&amp;amp; indx &amp;lt;= 0.05, "2",
                                indx &amp;gt; 0.05 &amp;amp;&amp;amp; indx &amp;lt;= 0.10, "3",
                                indx &amp;gt; 0.10 &amp;amp;&amp;amp; indx &amp;lt;= 0.20, "4",
                                indx &amp;gt; 0.20, "5")
    RETURN grade,
        VAR indx = DIVIDE(SUM('Table'[vl_pe]), sum('Table'[vl_pvs]), 1)-1
        VAR grade = SWITCH(TRUE, indx &amp;lt;= 0.01, "1",
                                indx &amp;gt; 0.01 &amp;amp;&amp;amp; indx &amp;lt;= 0.05, "2",
                                indx &amp;gt; 0.05 &amp;amp;&amp;amp; indx &amp;lt;= 0.10, "3",
                                indx &amp;gt; 0.10 &amp;amp;&amp;amp; indx &amp;lt;= 0.20, "4",
                                indx &amp;gt; 0.20, "5")
    RETURN grade
)&lt;/LI-CODE&gt;&lt;P&gt;I would like to use the value in the Measure 2 e.g. (1,2,3,4,5) to change it´s cell color, but I was unable to find a solution. I´m newbe in DAX .&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Sep 2023 12:31:56 GMT</pubDate>
    <dc:creator>mslino</dc:creator>
    <dc:date>2023-09-21T12:31:56Z</dc:date>
    <item>
      <title>Conditional formating using a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formating-using-a-Measure/m-p/3441513#M130747</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a measure to be used in a Matrix usinf the bellow code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Measure 2 = IF (
    ISINSCOPE('Table[nm_mdld]),
        VAR indx = DIVIDE(SUM('Table'[vl_pe]), sum('Table'[vl_pvs]), 1)-1
        VAR grade = SWITCH(TRUE, indx &amp;lt;= 0.01, "1",
                                indx &amp;gt; 0.01 &amp;amp;&amp;amp; indx &amp;lt;= 0.05, "2",
                                indx &amp;gt; 0.05 &amp;amp;&amp;amp; indx &amp;lt;= 0.10, "3",
                                indx &amp;gt; 0.10 &amp;amp;&amp;amp; indx &amp;lt;= 0.20, "4",
                                indx &amp;gt; 0.20, "5")
    RETURN grade,
        VAR indx = DIVIDE(SUM('Table'[vl_pe]), sum('Table'[vl_pvs]), 1)-1
        VAR grade = SWITCH(TRUE, indx &amp;lt;= 0.01, "1",
                                indx &amp;gt; 0.01 &amp;amp;&amp;amp; indx &amp;lt;= 0.05, "2",
                                indx &amp;gt; 0.05 &amp;amp;&amp;amp; indx &amp;lt;= 0.10, "3",
                                indx &amp;gt; 0.10 &amp;amp;&amp;amp; indx &amp;lt;= 0.20, "4",
                                indx &amp;gt; 0.20, "5")
    RETURN grade
)&lt;/LI-CODE&gt;&lt;P&gt;I would like to use the value in the Measure 2 e.g. (1,2,3,4,5) to change it´s cell color, but I was unable to find a solution. I´m newbe in DAX .&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 12:31:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formating-using-a-Measure/m-p/3441513#M130747</guid>
      <dc:creator>mslino</dc:creator>
      <dc:date>2023-09-21T12:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional formating using a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formating-using-a-Measure/m-p/3444302#M130926</link>
      <description>&lt;P&gt;instead of returning "1"&amp;nbsp; you can return the name of the color.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 = IF (
    ISINSCOPE('Table[nm_mdld]),
        VAR indx = DIVIDE(SUM('Table'[vl_pe]), sum('Table'[vl_pvs]), 1)-1
        return SWITCH(TRUE, indx &amp;lt;= 0.01, "red",
                            indx &amp;lt;= 0.05, "pink",
                            indx &amp;lt;= 0.10, "yellow",
                            indx &amp;lt;= 0.20, "orange",
                            "green")
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then color by "field value".&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 16:41:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-formating-using-a-Measure/m-p/3444302#M130926</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-09-23T16:41:12Z</dc:date>
    </item>
  </channel>
</rss>

