<?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 count and sales for new, existing and lost customers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-count-and-sales-for-new-existing-and-lost-customers/m-p/2842269#M90828</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="116175" data-lia-user-login="summer18" class="lia-mention lia-mention-user"&gt;summer18&lt;/a&gt; , You need meausres like&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;/P&gt;
&lt;P&gt;this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 24 before current = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],eomonth(MAX('Date'[Date]),-1) ,-24,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yearly&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;BR /&gt;Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))&lt;BR /&gt;This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))&lt;BR /&gt;Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Only year vs Year, not a level below&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 24= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],(MAX('Date'[Date])) ,-24,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final measures&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;lost&lt;/STRONG&gt; =&lt;/P&gt;
&lt;P&gt;Countx(Values(Customer[Customer]), if(isblank([Last 24]), [Customer], blank()) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change measure as per need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;retain&lt;/STRONG&gt; =&lt;/P&gt;
&lt;P&gt;Countx(Values(Customer[Customer]), if(not(isblank([This Year])) &amp;amp;&amp;amp; not(isblank([Last Year])) , [Customer], blank()) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;new&lt;/STRONG&gt; =&lt;/P&gt;
&lt;P&gt;Countx(Values(Customer[Customer]), if(not(isblank([This Month])) &amp;amp;&amp;amp; (isblank([Last 24 before current ])) , [Customer], blank()) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer&lt;/P&gt;
&lt;P&gt;Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: &lt;A href="https://www.youtube.com/watch?v=W4EF1f_k6iY" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=W4EF1f_k6iY&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Customer Retention Part 1:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529&lt;/A&gt;&lt;BR /&gt;Customer Retention Part 2: Period over Period Retention :&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 10:45:51 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-10-14T10:45:51Z</dc:date>
    <item>
      <title>How to get count and sales for new, existing and lost customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-count-and-sales-for-new-existing-and-lost-customers/m-p/2841794#M90807</link>
      <description>&lt;P&gt;I need help in getting the count and sales for new, existing and lost customers.&amp;nbsp; I just created a sample image like below on what I need to achieve.&amp;nbsp; The chart will always display the current year's new, returning and lost customers by month.&amp;nbsp; I tried some sample Dax online but could not make them to work properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New = with current month sales but no sales for the past 24 months&lt;/P&gt;&lt;P&gt;Existing = has sales on current year and previous years&lt;/P&gt;&lt;P&gt;Lost = has sales more than 24 months ago&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry for my image below but the legend should be existing customer, not returning&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;I will highly appreciate if you can provide a sample pbix with how to achieve the measures.&amp;nbsp; I cannot attach my pbix due to large volume of data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 08:17:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-count-and-sales-for-new-existing-and-lost-customers/m-p/2841794#M90807</guid>
      <dc:creator>summer18</dc:creator>
      <dc:date>2022-10-14T08:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count and sales for new, existing and lost customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-count-and-sales-for-new-existing-and-lost-customers/m-p/2842269#M90828</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="116175" data-lia-user-login="summer18" class="lia-mention lia-mention-user"&gt;summer18&lt;/a&gt; , You need meausres like&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;/P&gt;
&lt;P&gt;this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 24 before current = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],eomonth(MAX('Date'[Date]),-1) ,-24,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yearly&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;BR /&gt;Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))&lt;BR /&gt;This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))&lt;BR /&gt;Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Only year vs Year, not a level below&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 24= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],(MAX('Date'[Date])) ,-24,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final measures&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;lost&lt;/STRONG&gt; =&lt;/P&gt;
&lt;P&gt;Countx(Values(Customer[Customer]), if(isblank([Last 24]), [Customer], blank()) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change measure as per need&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;retain&lt;/STRONG&gt; =&lt;/P&gt;
&lt;P&gt;Countx(Values(Customer[Customer]), if(not(isblank([This Year])) &amp;amp;&amp;amp; not(isblank([Last Year])) , [Customer], blank()) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;new&lt;/STRONG&gt; =&lt;/P&gt;
&lt;P&gt;Countx(Values(Customer[Customer]), if(not(isblank([This Month])) &amp;amp;&amp;amp; (isblank([Last 24 before current ])) , [Customer], blank()) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer&lt;/P&gt;
&lt;P&gt;Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: &lt;A href="https://www.youtube.com/watch?v=W4EF1f_k6iY" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=W4EF1f_k6iY&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Customer Retention Part 1:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529&lt;/A&gt;&lt;BR /&gt;Customer Retention Part 2: Period over Period Retention :&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 10:45:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-count-and-sales-for-new-existing-and-lost-customers/m-p/2842269#M90828</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-10-14T10:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count and sales for new, existing and lost customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-count-and-sales-for-new-existing-and-lost-customers/m-p/2843472#M90900</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;, you're truly awesome!&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 02:58:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-count-and-sales-for-new-existing-and-lost-customers/m-p/2843472#M90900</guid>
      <dc:creator>summer18</dc:creator>
      <dc:date>2022-10-15T02:58:29Z</dc:date>
    </item>
  </channel>
</rss>

