<?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: Sum with condition in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4017350#M158393</link>
    <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reply. Technically I used the a similar approach which also returns correct values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Jun 2024 22:57:27 GMT</pubDate>
    <dc:creator>cyuan</dc:creator>
    <dc:date>2024-06-30T22:57:27Z</dc:date>
    <item>
      <title>Sum with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4007889#M157119</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’d like to create a sum by quarter but only for month age greater than 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in below case, the first condition is to look at month age, as long as it is greater than 3, then sum from very first value in sales (Nov 2023 in this case)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below is what I used however it didnt return me Nov and Dec 2023 as they are below month age 3 level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;N_Sales =&lt;/SPAN&gt; &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&g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;/TD&gt;&lt;TD&gt;1/03/2024&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA333&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;1/04/2024&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA333&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;1/05/2024&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 25 Jun 2024 01:10:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4007889#M157119</guid>
      <dc:creator>cyuan</dc:creator>
      <dc:date>2024-06-25T01:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4008064#M157182</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;expected result: =
VAR _t =
    FILTER (
        Sales,
        CALCULATE ( DATEDIFF ( MAX ( Sales[Date] ), TODAY (), MONTH ) ) &amp;gt; 3
    )
RETURN
    SUMX ( _t, Sales[Sales] )
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 25 Jun 2024 02:50:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4008064#M157182</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-06-25T02:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4010501#M157814</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="765300" data-lia-user-login="cyuan" class="lia-mention lia-mention-user"&gt;cyuan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;very much for the solution, and&amp;nbsp;I've tried other ways to help you understand the problem:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I guess what you mean is that you want to ask for the value of sales under your selected month age &amp;gt; 3. Here's a bit of advice for you:&lt;/P&gt;
&lt;P&gt;When you use the algorithmic logic you have shown, you need to make sure that it is used in a calculated column and that sales cannot be a value calculated by measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = if(('Table'[Month Age])&amp;lt;=3,blank(),[Slaes])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You change to the new data source you need to use in the following actions.&lt;/P&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Tom Shen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 06:22:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4010501#M157814</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-26T06:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4017350#M158393</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reply. Technically I used the a similar approach which also returns correct values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 22:57:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4017350#M158393</guid>
      <dc:creator>cyuan</dc:creator>
      <dc:date>2024-06-30T22:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4017351#M158394</link>
      <description>&lt;P&gt;Thanks Jihwan, i've tried SUMX and it works too. much apprecaited.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 22:58:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-condition/m-p/4017351#M158394</guid>
      <dc:creator>cyuan</dc:creator>
      <dc:date>2024-06-30T22:58:18Z</dc:date>
    </item>
  </channel>
</rss>

