<?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: Bug when using Summarize inside SumX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bug-when-using-Summarize-inside-SumX/m-p/3414575#M129163</link>
    <description>&lt;P&gt;Use EVALUATEANDLOG&amp;nbsp; to observe the different filter contexts, the transitions, and the lineages.&amp;nbsp; Then refactor your code to achieve your requirement.&amp;nbsp; For development work you should avoid nesting measures inside each other, that makes it really hard to troubleshoot.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Sep 2023 23:44:39 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-09-04T23:44:39Z</dc:date>
    <item>
      <title>Bug when using Summarize inside SumX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bug-when-using-Summarize-inside-SumX/m-p/3411591#M128966</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to summarize a table to use it within a SUMX function. The creation of the table works as expected because I created a calculated table to check it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DAX
Var Weighted_Score = CALCULATETABLE(
ADDCOLUMNS(
SUMMARIZE('OpenWells Principal', 'Responsável'[Responsável], 'Intervenções'[Intervenções], 'Dados Sondas'[Casco / Capacidade]),
"Nota5", [Nota Logística 5],
"Proporcao", [Proporçao Un Operacional]
)
)&lt;/LI-CODE&gt;&lt;P&gt;Then I use this table in SUMX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DAX&lt;BR /&gt;Var Sum_Score = SUMX(Weighted_Score, [Nota5] * [Proporcao])&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;What's happening strangely is that within the [Nota Logística 5] measure, there's a condition for when another measure called [Principal total OW (P50)] is equal to zero. The condition is as follows:&lt;/P&gt;&lt;PRE&gt;DAX&lt;BR /&gt;Nota Logística 5 = &lt;BR /&gt;Var Realized = [Principal total OW (P50)]&lt;BR /&gt;Var Target = [Meta P50 logística]&lt;BR /&gt;Var Score4 = [Nota Logística 4]&lt;BR /&gt;Var Total_tt = [Principal total OW operações (hs)]&lt;BR /&gt;&lt;BR /&gt;SWITCH(TRUE(),&lt;BR /&gt;Realized &amp;gt; 0 &amp;amp;&amp;amp; Target &amp;gt; 0, Score4, &lt;BR /&gt;Target = BLANK() &amp;amp;&amp;amp; Total_tt &amp;gt; 0, 50,&lt;BR /&gt;OR(Realized = 0, Realized = BLANK()) &amp;amp;&amp;amp; Total_tt &amp;gt; 0, 100&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;So, when I insert the virtual table into the SUMX, the condition is completely ignored. Everything is normal in the virtual table, as can be seen in the table below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when this table enters as a variable within the SUMX, it cannot calculate the score when [Principal total OW (P50)] = zero. It looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you all!!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 20:49:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bug-when-using-Summarize-inside-SumX/m-p/3411591#M128966</guid>
      <dc:creator>Yerece</dc:creator>
      <dc:date>2023-09-01T20:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Bug when using Summarize inside SumX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bug-when-using-Summarize-inside-SumX/m-p/3414575#M129163</link>
      <description>&lt;P&gt;Use EVALUATEANDLOG&amp;nbsp; to observe the different filter contexts, the transitions, and the lineages.&amp;nbsp; Then refactor your code to achieve your requirement.&amp;nbsp; For development work you should avoid nesting measures inside each other, that makes it really hard to troubleshoot.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 23:44:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bug-when-using-Summarize-inside-SumX/m-p/3414575#M129163</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-09-04T23:44:39Z</dc:date>
    </item>
  </channel>
</rss>

