<?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: Calcualting repeat cusotmers for each month and then totaling it up for all months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcualting-repeat-cusotmers-for-each-month-and-then-totaling-it/m-p/4036201#M159959</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="732527" data-lia-user-login="syedshah01" class="lia-mention lia-mention-user"&gt;syedshah01&lt;/a&gt;&amp;nbsp;check &lt;A href="https://www.daxpatterns.com/new-and-returning-customers/" target="_self"&gt;link&lt;/A&gt; with example&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2024 05:33:36 GMT</pubDate>
    <dc:creator>some_bih</dc:creator>
    <dc:date>2024-07-11T05:33:36Z</dc:date>
    <item>
      <title>Calcualting repeat cusotmers for each month and then totaling it up for all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcualting-repeat-cusotmers-for-each-month-and-then-totaling-it/m-p/4033154#M159645</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement where for each month starting six months ago until current selected month, it should calculate the repeat customers that purchased in any previous months and then total up the repeat customers for all six months. For example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are ten customers, A, B, C, D, E, F, G, H, I, J. Customer A, B, C, D and E purchased a product in December. In January, we have D, E, F cusotmers so we have two repeat customers. In Feb, A, H and I purchased. Since A, purchased previously (Dec), we have 1 repeat cusotmer in Feb. In March, we have B, E, H and J so we have three repeat customers and so on. We calculate this until current month. Eventually, we total up the repeat for all months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I calcualte this using DAX?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 19:42:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcualting-repeat-cusotmers-for-each-month-and-then-totaling-it/m-p/4033154#M159645</guid>
      <dc:creator>syedshah01</dc:creator>
      <dc:date>2024-07-09T19:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calcualting repeat cusotmers for each month and then totaling it up for all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcualting-repeat-cusotmers-for-each-month-and-then-totaling-it/m-p/4036201#M159959</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="732527" data-lia-user-login="syedshah01" class="lia-mention lia-mention-user"&gt;syedshah01&lt;/a&gt;&amp;nbsp;check &lt;A href="https://www.daxpatterns.com/new-and-returning-customers/" target="_self"&gt;link&lt;/A&gt; with example&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 05:33:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcualting-repeat-cusotmers-for-each-month-and-then-totaling-it/m-p/4036201#M159959</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2024-07-11T05:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calcualting repeat cusotmers for each month and then totaling it up for all months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcualting-repeat-cusotmers-for-each-month-and-then-totaling-it/m-p/4055701#M160950</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="732527" data-lia-user-login="syedshah01" class="lia-mention lia-mention-user"&gt;syedshah01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I create a table as you mentioned.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then I create three measures and here are the DAX codes.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;12m-1m = 
CALCULATE(
    DISTINCTCOUNT('Table'[CustomerID]),
    FILTER(
        'Table',
        (
            NOT(ISBLANK('Table'[12m])) &amp;amp;&amp;amp; NOT(ISBLANK('Table'[1m]))
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;12m-2m = 
CALCULATE(
    DISTINCTCOUNT('Table'[CustomerID]),
    FILTER(
        'Table',
        (
            NOT(ISBLANK('Table'[12m])) &amp;amp;&amp;amp; NOT(ISBLANK('Table'[2m]))
        ) || (
            NOT(ISBLANK('Table'[1m])) &amp;amp;&amp;amp; NOT(ISBLANK('Table'[2m]))
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;12m-3m = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[CustomerID] ),
    FILTER (
        'Table',
        ( NOT ( ISBLANK ( 'Table'[12m] ) ) &amp;amp;&amp;amp; NOT ( ISBLANK ( 'Table'[3m] ) ) )
            || ( NOT ( ISBLANK ( 'Table'[1m] ) ) &amp;amp;&amp;amp; NOT ( ISBLANK ( 'Table'[3m] ) ) )
            || ( NOT ( ISBLANK ( 'Table'[2m] ) ) &amp;amp;&amp;amp; NOT ( ISBLANK ( 'Table'[3m] ) ) )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Finally you can count all the measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total = 'Table'[12m-1m] + 'Table'[12m-2m] +'Table'[12m-3m]&lt;/LI-CODE&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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 07:26:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calcualting-repeat-cusotmers-for-each-month-and-then-totaling-it/m-p/4055701#M160950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-23T07:26:00Z</dc:date>
    </item>
  </channel>
</rss>

