<?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: IF() DAX not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2495830#M68838</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283796" data-lia-user-login="MCMM" class="lia-mention lia-mention-user"&gt;MCMM&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;What do you mean by (keeps summing)? If your problem is with the wrong total then you may try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Last Closed Month =
SUMX (
    SUMMARIZE ( DateTable, DateTable[Year], DateTable[Month] ),
    CALCULATE ( IF ( A = 0, B, A ) )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 05 May 2022 11:01:34 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-05-05T11:01:34Z</dc:date>
    <item>
      <title>IF() DAX not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2495600#M68824</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are facing a really simple issue with IF() Dax. What we are trying to achieve is IF (A=0, B, A). For that, we created 3 measures:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;A= amount for previous month&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;B = amount for before previous month&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Last Closed Month = IF(A=0,B,A)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see in the image below, both A and B measures work correctly, but the last closed month is retrieving A+B:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;We tried to change the logic to =BLANK(), =””,&amp;lt;&amp;gt;0, &amp;lt;&amp;gt;BLANK()… but no matter what we do, the last measure keeps summing A+B.&lt;/P&gt;&lt;P&gt;Are we missing something here? We have never faced this issue with an IF statement before….&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 09:05:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2495600#M68824</guid>
      <dc:creator>MCMM</dc:creator>
      <dc:date>2022-05-05T09:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: IF() DAX not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2495649#M68826</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283796" data-lia-user-login="MCMM" class="lia-mention lia-mention-user"&gt;MCMM&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;well the total row uses your logic on its aggregation. As A Total &amp;gt; 0, it will take A Total for Last Closed Month Total as your if statement says.&lt;BR /&gt;&lt;BR /&gt;Can you upload your file?&lt;BR /&gt;&lt;BR /&gt;Liked this post? More Content on:&lt;BR /&gt;&lt;A href="https://www.youtube.com/channel/UC2lAgCgfyLCHsRv0h-ETBWQ" target="_blank"&gt;https://www.youtube.com/channel/UC2lAgCgfyLCHsRv0h-ETBWQ&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 09:25:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2495649#M68826</guid>
      <dc:creator>TOK</dc:creator>
      <dc:date>2022-05-05T09:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: IF() DAX not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2495830#M68838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283796" data-lia-user-login="MCMM" class="lia-mention lia-mention-user"&gt;MCMM&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;What do you mean by (keeps summing)? If your problem is with the wrong total then you may try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Last Closed Month =
SUMX (
    SUMMARIZE ( DateTable, DateTable[Year], DateTable[Month] ),
    CALCULATE ( IF ( A = 0, B, A ) )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 May 2022 11:01:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2495830#M68838</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-05T11:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: IF() DAX not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2557579#M72668</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283796" data-lia-user-login="MCMM" class="lia-mention lia-mention-user"&gt;MCMM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The if function in table visual is fine, it is working properly. If you don't want the total in the total row, you can either turn it off or use hasonevalue() or hasonefilter() or isfiltered() to customize the value in the total&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Community Support Team _Tang&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 09:56:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-DAX-not-working/m-p/2557579#M72668</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2022-06-03T09:56:01Z</dc:date>
    </item>
  </channel>
</rss>

