<?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: How to get customers have no Sales for three previous months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4294852#M170459</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;thanks alot .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I want to find customers who de not have any sales from &lt;SPAN&gt;period&amp;nbsp;&lt;/SPAN&gt;date , meaning if I selected from 1/1/2024 to 30/3/2024, want to see customers who do not have any sales in this range date, meaning they do not have any purchase invoice&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I write DAX that does this for me ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;can you help me Please ?&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2024 08:10:44 GMT</pubDate>
    <dc:creator>amal_01</dc:creator>
    <dc:date>2024-11-21T08:10:44Z</dc:date>
    <item>
      <title>How to get customers have no Sales for three previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4280404#M169871</link>
      <description>&lt;P&gt;I have two tables CustInvoiceJour , CustInvoiceTrans are connected by the &lt;EM&gt;InvoiceId&lt;/EM&gt; field in both tables.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added a slicer for &lt;EM&gt;InvoiceDate&lt;/EM&gt; from the &lt;EM&gt;CustInvoiceTrans&lt;/EM&gt; table. I want to identify customers who have no sales for three previous months from the date selected in the slicer.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;LineAmount&lt;/EM&gt; is the column for sales amount.&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;InvoiceAccount&lt;/EM&gt; represents the customer number.&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;DeliveryName&lt;/EM&gt; is the customer name.&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;InvoiceDate&lt;/EM&gt; is the sales date.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 19:00:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4280404#M169871</guid>
      <dc:creator>amal_01</dc:creator>
      <dc:date>2024-11-12T19:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get customers have no Sales for three previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4280452#M169874</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="666147" data-lia-user-login="amal_01" class="lia-mention lia-mention-user"&gt;amal_01&lt;/a&gt;&amp;nbsp;Create a table VAR for customers in the current month. VAR __Table1 = SELECTCOLUMNS( FILTER( ALL('Table'), [Date] &amp;gt;= EOMONTH( MAX('Table'[Date]), -1 ) + 1 &amp;amp;&amp;amp; [Date] &amp;lt;= MAX('Table'[Date]) ), "Customer", [Customer] ). Create a table VAR for customers in the previous three months. VAR __Table2 = SELECTCOLUMNS( FILTER( ALL( 'Table' ), [Date] &amp;lt; EOMONTH( MAX('Table'[Date]), -1 ) + 1 &amp;amp;&amp;amp; [Date] &amp;gt;= EOMONTH( MAX('Table[Date]), -4 ) + 1 ), "Customer", [Customer] ). Then do an EXCEPT. EXCEPT( __Table1, __Table2 )&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 19:39:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4280452#M169874</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-11-12T19:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get customers have no Sales for three previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4290786#M170278</link>
      <description>&lt;P&gt;Thanks for the reply from Greg_Deckler, please allow me to provide another insight.&lt;BR /&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="666147" data-lia-user-login="amal_01" class="lia-mention lia-mention-user"&gt;amal_01&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Please refers to the following steps.&lt;BR /&gt;&lt;BR /&gt;The test data are as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Use the following DAX to create a measure to identify customers in the previous three months.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ISInPre3Months = 
VAR _selectedDate = CALCULATE(MAX('CustInvoiceTrans'[InvoiceDate]),
ALLSELECTED(CustInvoiceTrans[InvoiceDate]),
ALLEXCEPT(CustInvoiceTrans,CustInvoiceTrans[InvoiceDate]),
REMOVEFILTERS('CustInvoiceJour'))
VAR _tb = CALCULATETABLE('CustInvoiceTrans', DATESINPERIOD('CustInvoiceTrans'[InvoiceDate],_selectedDate,-3,MONTH))
RETURN
 MAXX(FILTER(_tb,[InvoiceId]='CustInvoiceTrans'[InvoiceId]),[InvoiceId])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Use the following DAX to create a measure that calculates sales per customer for the previous three months.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales for previous 3 months = 
VAR _selectedDate = CALCULATE(MAX('CustInvoiceTrans'[InvoiceDate]),
ALLSELECTED(CustInvoiceTrans[InvoiceDate]),
ALLEXCEPT(CustInvoiceTrans,CustInvoiceTrans[InvoiceDate]),
REMOVEFILTERS('CustInvoiceJour'))

VAR _tb = CALCULATETABLE('CustInvoiceTrans', DATESINPERIOD('CustInvoiceTrans'[InvoiceDate],_selectedDate,-3,MONTH))
RETURN
IF([ISInPre3Months]&amp;lt;&amp;gt;BLANK(),
SUMX(FILTER(_tb,[InvoiceId]='CustInvoiceTrans'[InvoiceId]),[LineAmount])
)&lt;/LI-CODE&gt;
&lt;P&gt;Add this two measures to the visual's filter pane and set them to “Is not blank” and "Is blank".The final result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Please see the attached pbix for reference.&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dengliang Li&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 10:07:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4290786#M170278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-19T10:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get customers have no Sales for three previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4294852#M170459</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;thanks alot .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I want to find customers who de not have any sales from &lt;SPAN&gt;period&amp;nbsp;&lt;/SPAN&gt;date , meaning if I selected from 1/1/2024 to 30/3/2024, want to see customers who do not have any sales in this range date, meaning they do not have any purchase invoice&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I write DAX that does this for me ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;can you help me Please ?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 08:10:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-customers-have-no-Sales-for-three-previous-months/m-p/4294852#M170459</guid>
      <dc:creator>amal_01</dc:creator>
      <dc:date>2024-11-21T08:10:44Z</dc:date>
    </item>
  </channel>
</rss>

