<?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: Count returning customers who have orders every month for X number of months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571592#M31327</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , This measure can give distinct month has sales , with help from date table&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(distinctcount('Date'[Month-Year]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),0),-3,MONTH), not(isblank(Sales[Sales Amount])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count of customers having entry in three month&lt;/P&gt;
&lt;P&gt;new Measure = countx(filter(Summarize(Sales, sales[Customer], "_1",[Rolling 3]),[_1]=3),[Customer])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Dec 2020 05:33:54 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-12-28T05:33:54Z</dc:date>
    <item>
      <title>Count returning customers who have orders every month for X number of months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571119#M31304</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm seeking help to get the count of customers who have placed orders at least once every month for the past X months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I am hoping to capture the count of customers who have orders in October, November and December (past 2 months&amp;nbsp; and current month).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help and guidance is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ashley&lt;/P&gt;</description>
      <pubDate>Sun, 27 Dec 2020 13:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571119#M31304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-27T13:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count returning customers who have orders every month for X number of months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571184#M31308</link>
      <description>&lt;P&gt;Hi!&amp;nbsp; Here's some DAX for something similar I did...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR Weeks = 2
VAR CurrentWeek =
    CALCULATETABLE (
        VALUES ( IdentityLog[IdentityId] ),
        DATESINPERIOD (
            'Calendar'[Date],
            DATEADD (
                LASTDATE ( 'Calendar'[Date] ),
                ( Weeks * 7 ) + 1,
                DAY
            ),
            7,
            DAY
        )
    )
VAR PreviousWeek =
    CALCULATETABLE (
        VALUES ( IdentityLog[IdentityId] ),
        DATESINPERIOD (
            'Calendar'[Date],
            DATEADD (
                LASTDATE ( 'Calendar'[Date] ),
                ( ( Weeks - 1 ) * 7 ) + 1,
                DAY
            ),
            7,
            DAY
        )
    )
VAR TwoWeeksAgo =
    CALCULATETABLE (
        VALUES ( IdentityLog[IdentityId] ),
        DATESINPERIOD (
            'Calendar'[Date],
            DATEADD (
                LASTDATE ( 'Calendar'[Date] ),
                ( ( Weeks - 2 ) * 7 ) + 1,
                DAY
            ),
            7,
            DAY
        )
    )
RETURN

COUNTROWS (
    CALCULATETABLE (
        VALUES(IdentityLog[IdentityId]),
        CurrentWeek,
        PreviousWeek,
        TwoWeeksAgo
    )
)&lt;/LI-CODE&gt;&lt;P&gt;The measure above is intended to get the count of users who have logged in each week for three consecutive weeks.&amp;nbsp; Replace my logic for weeks with current month, prior month and two months ago (&lt;A href="https://docs.microsoft.com/en-us/dax/parallelperiod-function-dax" target="_self"&gt;PARALLELPERIOD()&lt;/A&gt; should make that very easy!).&lt;/P&gt;</description>
      <pubDate>Sun, 27 Dec 2020 16:00:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571184#M31308</guid>
      <dc:creator>littlemojopuppy</dc:creator>
      <dc:date>2020-12-27T16:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count returning customers who have orders every month for X number of months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571220#M31314</link>
      <description>&lt;P&gt;hey this would do the trick (a measure):&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var a = 0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var b = 365&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(DISTINCTCOUNT('orders report'[month value column]),(TODAY()-'Date Dim Table'[Date])&amp;lt;b,(TODAY()-'Date Dim Table'[Date])&amp;gt;=a) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this will determine if it its between last 365 days (1 year) and if so count by each different moth it exists on it, when applied to a table the filter will kick in with the desire visual)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;note I use a date dimensional table, you can do it without it using the date in the fact table also.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Result of it:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;if this was of help for your need let us know makring as soluction.&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 27 Dec 2020 17:30:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571220#M31314</guid>
      <dc:creator>StefanoGrimaldi</dc:creator>
      <dc:date>2020-12-27T17:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count returning customers who have orders every month for X number of months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571592#M31327</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , This measure can give distinct month has sales , with help from date table&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(distinctcount('Date'[Month-Year]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),0),-3,MONTH), not(isblank(Sales[Sales Amount])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count of customers having entry in three month&lt;/P&gt;
&lt;P&gt;new Measure = countx(filter(Summarize(Sales, sales[Customer], "_1",[Rolling 3]),[_1]=3),[Customer])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 05:33:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1571592#M31327</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-12-28T05:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count returning customers who have orders every month for X number of months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1572675#M31360</link>
      <description>&lt;P&gt;Thank you all for the solutions. I spent the last 2 weeks trying to find a solution myself on google search and got a solution within 1 day in this community. :). You guys are great!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 00:23:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-returning-customers-who-have-orders-every-month-for-X/m-p/1572675#M31360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-29T00:23:20Z</dc:date>
    </item>
  </channel>
</rss>

