<?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: DAX sum filter dates. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174301#M18232</link>
    <description>&lt;P&gt;Let me revise what I posted. We consider&lt;/P&gt;&lt;P&gt;Case 1 = the customer is retained if the customer only bought our company's unit in last 2 years, the customer is retained&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 2 = if the customer did not purchased any products (which means did not buy any other competing companies' product) for 2 years but bought our company's product on 3rd year, then the customer is retained.&lt;/P&gt;&lt;P&gt;Case 3 = if the customer did not purchased any other brands' product but bought our product for the last 3 years straight, then the customer is retained.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jun 2020 19:30:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-06-22T19:30:50Z</dc:date>
    <item>
      <title>DAX sum filter dates.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1173930#M18214</link>
      <description>&lt;P&gt;Hi, I'm trying to get rentention percentage of each customer ID, but there are 3 conditions that identify the customer is retained or not. (if any of these are appliable, then the customer is retained.)&lt;/P&gt;&lt;P&gt;case 1&amp;nbsp; is if customer purchased our company unit within 24months, the customer is retained.&amp;nbsp;&lt;/P&gt;&lt;P&gt;case 2 is if customer did not purchased our product for last 23 months but bought our product on the 3rd year&lt;/P&gt;&lt;P&gt;case 3 if customer did not purchased our product for last 23 months but bought our product within the first three year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data is arranged like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table Products&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;CUSTOMER ID&lt;/TD&gt;&lt;TD&gt;DATE&lt;/TD&gt;&lt;TD&gt;Manufacturer&lt;/TD&gt;&lt;TD&gt;Units&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2012&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;XXXXXXXX&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;03/04/2012&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2013&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;XXXXXXXX&lt;/TD&gt;&lt;TD&gt;04/05/2013&lt;/TD&gt;&lt;TD&gt;Banana&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014&lt;/TD&gt;&lt;TD&gt;XXXXXXXX&lt;/TD&gt;&lt;TD&gt;01/05/2014&lt;/TD&gt;&lt;TD&gt;Banana&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2015&lt;/TD&gt;&lt;TD&gt;XXXXXXXX&lt;/TD&gt;&lt;TD&gt;08/12/2015&lt;/TD&gt;&lt;TD&gt;Watermelon&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I need to create new columns about each cases next to the units column. If the customer is retained, then put 1, otherwise 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've used&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Case 1 = if(calculate(sum('Products'[Units]),filter('Products',Products'[Manufacturer]="Banana"),DATESINPERIOD('Products'[Date],max(Products'[Date]),-2,year))&amp;gt;0,1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;but keep getting wrong. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please help me on this. Thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 22 Jun 2020 16:06:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1173930#M18214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T16:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: DAX sum filter dates.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1173950#M18215</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can check this video for calculating the customers as per the criterias.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=cfDyNPQIJtA" target="_blank"&gt;https://www.youtube.com/watch?v=cfDyNPQIJtA&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 16:13:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1173950#M18215</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T16:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX sum filter dates.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174256#M18227</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Shouldn't you be checking if they purchased something in the 2 year ahead to classify them as retained? In that case you need something like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Retention = 
var _sv = SELECTEDVALUE(Products[DATE]) +1

return
IF(SELECTEDVALUE(Products[Manufacturer])="Banana"; //Only for our products, Banana;
IF(            //Use the whole table, and then set some filters.
        CALCULATE(SUM(Products[Units]);ALL(Products);Products[Manufacturer]="Banana";
            DATESINPERIOD(Products[DATE];_sv;2;YEAR))
            &amp;gt; 0 ; 1 ; 0))&lt;/LI-CODE&gt;&lt;P&gt;As seen here:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 18:51:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174256#M18227</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-22T18:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAX sum filter dates.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174301#M18232</link>
      <description>&lt;P&gt;Let me revise what I posted. We consider&lt;/P&gt;&lt;P&gt;Case 1 = the customer is retained if the customer only bought our company's unit in last 2 years, the customer is retained&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 2 = if the customer did not purchased any products (which means did not buy any other competing companies' product) for 2 years but bought our company's product on 3rd year, then the customer is retained.&lt;/P&gt;&lt;P&gt;Case 3 = if the customer did not purchased any other brands' product but bought our product for the last 3 years straight, then the customer is retained.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 19:30:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174301#M18232</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T19:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAX sum filter dates.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174350#M18234</link>
      <description>&lt;P&gt;Case 1 seems to have a strange meaning with respect to retention?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 20:02:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174350#M18234</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-22T20:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX sum filter dates.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174373#M18235</link>
      <description>&lt;P&gt;I think we use case 1 for calculating loyalty % of customers later.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 20:19:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174373#M18235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T20:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: DAX sum filter dates.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174427#M18236</link>
      <description>&lt;P&gt;Good resource, but did not solved my question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 20:57:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-sum-filter-dates/m-p/1174427#M18236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T20:57:30Z</dc:date>
    </item>
  </channel>
</rss>

