<?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 Sum if customer has more than two invoices in last twelve m in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2305174#M57051</link>
    <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to create a calculation of sales in the previous 12 months per customer using the following measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Sales Previous 12 Months =&lt;/P&gt;&lt;P&gt;VAR CurrentDate = SELECTEDVALUE('Date'[End of Month Date],MAX('Date'[End of Month Date]))&lt;/P&gt;&lt;P&gt;VAR PreviousDate = CurrentDate - 365&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;[Total Sales],&lt;/P&gt;&lt;P&gt;FILTER(&lt;/P&gt;&lt;P&gt;'Budget and last year per month',&lt;/P&gt;&lt;P&gt;'Budget and last year per month'[Date] &amp;gt;= PreviousDate &amp;amp;&amp;amp; 'Budget and last year per month'[Date] &amp;lt;= CurrentDate&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;However, I would like to add an additional filter that only shows customers with =&amp;gt; 2 invoices in the selected period (last twelve months from selected date).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how I can add this to the above?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 27 Jan 2022 12:37:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-27T12:37:08Z</dc:date>
    <item>
      <title>Sum if customer has more than two invoices in last twelve m</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2305174#M57051</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to create a calculation of sales in the previous 12 months per customer using the following measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Sales Previous 12 Months =&lt;/P&gt;&lt;P&gt;VAR CurrentDate = SELECTEDVALUE('Date'[End of Month Date],MAX('Date'[End of Month Date]))&lt;/P&gt;&lt;P&gt;VAR PreviousDate = CurrentDate - 365&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;[Total Sales],&lt;/P&gt;&lt;P&gt;FILTER(&lt;/P&gt;&lt;P&gt;'Budget and last year per month',&lt;/P&gt;&lt;P&gt;'Budget and last year per month'[Date] &amp;gt;= PreviousDate &amp;amp;&amp;amp; 'Budget and last year per month'[Date] &amp;lt;= CurrentDate&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;However, I would like to add an additional filter that only shows customers with =&amp;gt; 2 invoices in the selected period (last twelve months from selected date).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how I can add this to the above?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jan 2022 12:37:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2305174#M57051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-27T12:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if customer has more than two invoices in last twelve m</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2305328#M57059</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , assume measure working correctly , create count or invoice for 12 month &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(filter(values(customer[customer]) , [count or invoice] &amp;gt;2) , [Total Sales Previous 12 Months]&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer these examples for rolling 12&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH)) &lt;BR /&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-12,MONTH)) &lt;BR /&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH)) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 14:09:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2305328#M57059</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-27T14:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if customer has more than two invoices in last twelve m</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2305416#M57064</link>
      <description>&lt;P&gt;That works beautifully! Thank you! The only problem now is that the row total sums to the same total as without the filter? Any idea why?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 14:49:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2305416#M57064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-27T14:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if customer has more than two invoices in last twelve m</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2307180#M57189</link>
      <description>&lt;P&gt;Fixed it myself by adding a new measure: Total Sales Sum =&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Customer[Customer]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;[Total Sales]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2022 08:45:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-if-customer-has-more-than-two-invoices-in-last-twelve-m/m-p/2307180#M57189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-28T08:45:38Z</dc:date>
    </item>
  </channel>
</rss>

