<?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: Customer Repurchase Cycle in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2098177#M47861</link>
    <description>&lt;P&gt;Hi Jannnn04,&lt;/P&gt;&lt;P&gt;For the first question, you can try calculate column as below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NewOld = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentUser = All_Platforms[User Name]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR RankByCust =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER( All_Platforms, All_Platforms[User Name] = CurrentUser ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;All_Platforms[OrderTime],&lt;/SPAN&gt;&lt;SPAN&gt; ,&lt;/SPAN&gt;&lt;SPAN&gt; ASC&lt;/SPAN&gt;&lt;SPAN&gt; )&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;IF( RankByCust &amp;gt; 1, "Old", "New" )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hope this helps you. Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 25 Sep 2021 21:28:53 GMT</pubDate>
    <dc:creator>colacan</dc:creator>
    <dc:date>2021-09-25T21:28:53Z</dc:date>
    <item>
      <title>Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2096423#M47782</link>
      <description>&lt;P&gt;Hi Community and PowerBi Masters,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently working on an analysis for which I try to understand the consumer behavior in detail.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The corresponding data that I have is (name of table: All_Platforms):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Order Number&lt;/P&gt;&lt;P&gt;-Order Time&lt;/P&gt;&lt;P&gt;-User Name&lt;/P&gt;&lt;P&gt;-BGR_ALL.Product Name&lt;/P&gt;&lt;P&gt;-BGR_ALL.Category&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a couple of things I want to understand and differentiate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.Variable needed in new column: &lt;STRONG&gt;d&lt;/STRONG&gt;&lt;STRONG&gt;ifferentiate between new and old customers&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;(based on User Name: is it a customer that purchased for the first time or does reouccuring purchases)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Understand on &lt;EM&gt;product and category level&lt;/EM&gt;, &lt;STRONG&gt;when a specific customer has purchased an item again.&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;- frequency:&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;how often did he repurchase within certain time frame&lt;/STRONG&gt;?&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;-time difference: &lt;EM&gt;(product and category level)&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;how long does it take to be repurchased by consumers?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that is clear. Let me know if you need any more informatoin to solve my issue!&lt;/P&gt;&lt;P&gt;Highly appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best and many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Sep 2021 04:39:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2096423#M47782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-25T04:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2097742#M47826</link>
      <description>&lt;P&gt;Hi Jannnn04,&lt;/P&gt;&lt;P&gt;If you post your question one by one along with sample data, it would be easyer to answer. the question itself doesn't look that complicated but the answer would be quite broad without data. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 20:57:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2097742#M47826</guid>
      <dc:creator>colacan</dc:creator>
      <dc:date>2021-09-24T20:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2097918#M47836</link>
      <description>&lt;P&gt;Hi Colacan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your quick response.&amp;nbsp;&lt;BR /&gt;I will upload sample data and post the questions individually --&amp;gt; Updated the original post.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Sep 2021 04:28:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2097918#M47836</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-25T04:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2098177#M47861</link>
      <description>&lt;P&gt;Hi Jannnn04,&lt;/P&gt;&lt;P&gt;For the first question, you can try calculate column as below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NewOld = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentUser = All_Platforms[User Name]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR RankByCust =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER( All_Platforms, All_Platforms[User Name] = CurrentUser ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;All_Platforms[OrderTime],&lt;/SPAN&gt;&lt;SPAN&gt; ,&lt;/SPAN&gt;&lt;SPAN&gt; ASC&lt;/SPAN&gt;&lt;SPAN&gt; )&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;IF( RankByCust &amp;gt; 1, "Old", "New" )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hope this helps you. Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 25 Sep 2021 21:28:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2098177#M47861</guid>
      <dc:creator>colacan</dc:creator>
      <dc:date>2021-09-25T21:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2098729#M47879</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; Hi,&lt;/P&gt;&lt;P&gt;The answer to Q1 is as I explained in eariler message:&lt;/P&gt;&lt;P&gt;Calculated Column:&lt;/P&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;NewOld =&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;VAR CurrentUser = All_Platforms[User Name]&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;VAR RankByCust =&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;RANKX(&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;FILTER( All_Platforms, All_Platforms[User Name] = CurrentUser ),&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;All_Platforms[OrderTime],&amp;nbsp;,&amp;nbsp;ASC&amp;nbsp;)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;IF( RankByCust &amp;gt; 1, "Old", "New" )&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The answer to Q2-1:&amp;nbsp;&lt;STRONG&gt;how often did he repurchase within certain time frame&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;You probably have a date table related to "All_Platforms" then simply,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;NumberOfPurchase = countrows(All_Platforms)&lt;/FONT&gt; along with Date filter will show how often(many times) the specific customer purchased item as below&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The answer to Q2-2:&amp;nbsp;&lt;STRONG&gt;how long does it take to be repurchased by consumers?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you are looking for average number of date for a customer to repurchase item,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I guess what you need are&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. The time difference between Last purchase date and First purchase date &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Total number of purchase.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. the answer would be DIVIDE(The time difference,&amp;nbsp;Total number of purchase)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Below is the measure to calculate it.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;AverageTime_Revisit = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR currentuser = Max(All_Platforms[User Name])&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR NumberOfDates =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEDIFF(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FIRSTNONBLANK( All_Platforms[OrderTime], All_Platforms[OrderTime] ),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LASTNONBLANK( All_Platforms[OrderTime], All_Platforms[OrderTime] ),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DAY&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),All_Platforms[User Name] = currentuser)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR NumberOfPurcases =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;COUNTROWS( FILTER( All_Platforms, All_Platforms[User Name] = currentuser ) )-1&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;if(ISINSCOPE(All_Platforms[User Name]),DIVIDE( NumberOfDates, NumberOfPurcases ),BLANK())&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;This measure works for any time period, product and category whichever you select.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;You can cross check it with your sample data.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;In below example.&lt;BR /&gt;I selected time period of 2021.2.4~2021.3.17.&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;as you can see, Emil purchased laptop 2 times and the interval between is 14 days.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps you. If you like my answer, please select my post as the Solution along with Kudo.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 26 Sep 2021 20:27:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2098729#M47879</guid>
      <dc:creator>colacan</dc:creator>
      <dc:date>2021-09-26T20:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2099114#M47892</link>
      <description>&lt;P&gt;Hi Colacan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you so much for your answer! It already helps a lot! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some comments:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;For the first question to differentiate between new and old: &lt;STRONG&gt;it works perfectly, thanks.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;For the second question (Q2-1Amount of purchases): the countrows function results in aggregating all rows but does not filter for the specific user's amount of purchases for category or product level.&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;For the third question (Q2-2; time diff. between purchases): the function itself works but results in empty cells/an empty column.&amp;nbsp;&lt;BR /&gt;&lt;img /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you maybe help me with that issues?&lt;/P&gt;&lt;P&gt;Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 03:50:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2099114#M47892</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-27T03:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2100773#M47941</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Hi, Jannnn04,&lt;BR /&gt;Q2-1 : Pllease double check the formular&lt;BR /&gt;it's&amp;nbsp;&lt;FONT color="#0000FF"&gt;NumberOfPurchase = countrows(All_Platforms)&lt;/FONT&gt;&amp;nbsp; &lt;FONT color="#FF0000"&gt;not&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#0000FF"&gt;countrows(&lt;FONT color="#FF0000"&gt;All&lt;/FONT&gt;(All_Platforms))&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In above table table, the value should be &lt;STRONG&gt;1&lt;/STRONG&gt;&amp;nbsp;for each row not 138.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me explain a bit here why the number should be 1 and this explanation is also realted to the answer to your Q2-2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;In above table, you have added all the columns, which means you have added all the conditions to get the number of Purchase under all these conditions.&lt;/P&gt;&lt;P&gt;Your question to power BI for the first row is:&lt;/P&gt;&lt;P&gt;"Show me how many items Emil bought Latop which is macbook on 3rd March 2021". of cuase the answer would be 1 because your question is too specific.&lt;/P&gt;&lt;P&gt;However if you change the question with less conditions by removing some columns,&lt;/P&gt;&lt;P&gt;""Show me how many items Emil bought Latop" then the answer would be 2 as below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer to Q2-2 will be the same. since you have put all the conditions in the table above, there are only unique and very specific cases. and there is no way to calculate time diffrence for 1 case. (at least 2 purchases are quired to calculate time difference)&lt;/P&gt;&lt;P&gt;but if you reduce conditions (reduce columns of the table), like&lt;/P&gt;&lt;P&gt;"How frequently Emil buy item?" ==&amp;gt; total 4 times and on average 24.3 days took for each purchase&lt;/P&gt;&lt;P&gt;OR "how frequently Emil bought macbook" ==&amp;gt; 14 days, and so on.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it clariied your concern.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 16:16:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2100773#M47941</guid>
      <dc:creator>colacan</dc:creator>
      <dc:date>2021-09-27T16:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2101649#M47966</link>
      <description>&lt;P&gt;Good Morning Colacan!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q2-1: I think I have found the core of the problem. I was creating columns instead of measures before (why is that so?). Now that I used measures with the formulars that you kindly provided, it almost perfectly works. There is just a small hick up, which I'd like to understand/circumvent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table now shows the correct values! Thank you at that stage already.&lt;/P&gt;&lt;P&gt;However, if I include the exact dates for which Emil purchased something, the average time between purchases disappears. Is there a way to keep the variable visible in the table for each day?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Also, I can not use the measure in a visualization really. Since it, as you described, always calculates a difference between two values, I can not depict the average repurchase time in a KPI card, in a gauge or in a bar chart - which was the goal. Would you know how to adjust that I would be able to display that?&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;Similarly, when displaying in a table, I would want to show the average time between purchases of categories/products&amp;nbsp;&lt;STRONG&gt;excluding&lt;/STRONG&gt; the users - so averaging on total category level. How would that work?&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards and many thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 07:37:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2101649#M47966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-28T07:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2103879#M48024</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; Hi, Jannnn04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. I was creating columns instead of measures before (why is that so?).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Calculate column evaluates each expression under row context. and filter context does not exist in calculate column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;COUNTROWS function, like SUM( ) or AVERAGE( ), conducts it's calculation under &lt;STRONG&gt;Filter context&lt;/STRONG&gt;.&amp;nbsp; since there is no filter context in calculate column, it calculates over entire table. that's why you got total number.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But measure is different. both CALCULATE and CALCULATETALBE invoke &lt;STRONG&gt;Context Transition &lt;/STRONG&gt;which means, these two function change Row context to Filter context (in other words, context transition makes the 1 row as it's filter). one important thing is that all measures are wrapped by CALCULATE function inside the engine regardless you used calculate function for your measure or not. Therefore, if you create a measure, it will colcuate for the current row only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Having say that, to create a column with the same result, you can simply wap the expression with CALCULATE as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Measure: NumberOfPurchase = countrows(All_Platforms)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Calculated column: NumberOfPurchase = CALCULATE(countrows(All_Platforms))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. &lt;U&gt;Average time with specific time:&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As I expalined previously, to calculate average time, you need at lease two transactions because the average time is the Time Gap between 2 transactions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to show the earler time and the average time in the same row in the report, you need to create a table for it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. &lt;U&gt;I can not depict the average repurchase time in a KPI card, in a gauge or in a bar chart &lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The measure (average time) needs customer as it's filter context because we cannot define re-purchase without "WHO" but the gauge does not have customer filter unless you select specific "customer" from outter filter. (e.g. selecting "Emil" with slicer).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to show overall "avg. revisiting time" regardless customer (which means average of revisiting time for all customers who purchased item at least twice), then it will be another measure which can be combined with eailer one (the indivisual average time).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In that case, the 2 measures can be combined as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;STRONG&gt;IF&lt;/STRONG&gt; indivisual is selected, return the value from&amp;nbsp;&lt;STRONG&gt;eailer measure&lt;/STRONG&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;STRONG&gt;else&lt;/STRONG&gt; return value from &lt;STRONG&gt;new measure.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(By the way, those customer who purchase only once shoule be excluded for the new measure.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can handle your issues with above guideline.&amp;nbsp; I may make the code when I find time but not sure when.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so If you are looking for the solution urgently, please find help from others.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 21:28:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2103879#M48024</guid>
      <dc:creator>colacan</dc:creator>
      <dc:date>2021-09-28T21:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2104254#M48039</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255602" data-lia-user-login="colacan" class="lia-mention lia-mention-user"&gt;colacan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;wow, thanks a lot, again. The explanations are really, really helpful! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried to create the code myself but so far I got stuck with both issue 1 and 2. Would be great if you can help me with that again. Really brilliant from you, thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am super sorry to further bother but I discovered another problem.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I now edited the data and have for one specific day, with one order number, many purchases from one customer (emil) for one product (macbook in category laptop). That decreased the the average time between purchases from that user. However, the real average time between purchases has not changed. He just purchased more items within one order.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;How can I change the code to treat a single, large order (with one order number) as a single transaction?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviosuly also happy if anyone else would want to assist colacan with his great work so far:)&lt;/P&gt;&lt;P&gt;Thanks a lot and best regards!&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 02:25:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2104254#M48039</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-29T02:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2115009#M48454</link>
      <description>&lt;P&gt;I still did not manage to solve that issue and would be super grateful if someone can assist! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks, community!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 01:06:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2115009#M48454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-05T01:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Customer Repurchase Cycle</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2120924#M48599</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; Hi, considering your issues I made measures as below. I hope this helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//[NumOfTotPurchase]: This counts all purchases even if order numbers are the same. e.g. if Emil purchased 4 macbooks on the same day under same oerder number, it still counts 4.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NumOfTotPurchase = countrows(All_Platforms)&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//[NumOfVisit]:&amp;nbsp; This counts only number of visit regardless number of purchases e.g. If Emil purchased 4 macbooks, if counts only 1 as long as all purchases are done under same order number&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NumOfVisit = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR currentuser =&lt;/SPAN&gt;&lt;SPAN&gt; MAX( All_Platforms[User Name] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR NumOfVisit =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;COUNTROWS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;DISTINCT(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;SPAN&gt;SELECTCOLUMNS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;SPAN&gt;FILTER( All_Platforms, All_Platforms[User Name] = currentuser ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;SPAN&gt;"OrderNum", All_Platforms[Order Number],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;SPAN&gt;"Name", All_Platforms[User Name]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;Return NumOfVisit&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//[NumOfReVisit]:&amp;nbsp; This is the same as above [NumOfVisit] but it excludes the first visit. hence the formular is simply [NumOfVisit]-1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NumOfReVisit = [NumOfVisit]-1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//[AVG_Time_Revisit_Indv]:&amp;nbsp; This is similar to the measure [AverageTime_Revisit]&amp;nbsp;which I provided previously but it is revised to ignore bulk purchase under the same order number. But this measure cannot be used universal purpose(e.g. KPI card) since it needs specific "Name".&amp;nbsp; Just make this measure in your model but don't use this. this measure will be used internally to make the final new measure&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AVG_Time_Revisit_Indv = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR currentuser = MAX( All_Platforms[User Name] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR NumberOfDates =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;DATEDIFF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;SPAN&gt;FIRSTNONBLANK( All_Platforms[OrderTime], All_Platforms[OrderTime] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;SPAN&gt;LASTNONBLANK( All_Platforms[OrderTime], All_Platforms[OrderTime] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;All_Platforms[User Name] = currentuser&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR NumberOfRePurcases =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;COUNTROWS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;DISTINCT(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;SPAN&gt;SELECTCOLUMNS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;SPAN&gt;FILTER( All_Platforms, All_Platforms[User Name] = currentuser ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;SPAN&gt;"OrderNum", All_Platforms[Order Number],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;SPAN&gt;"Name", All_Platforms[User Name]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;) - 1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR Avg_Time_Interval =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;DIVIDE( NumberOfDates, NumberOfRePurcases ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;ALLSELECTED( all_Platforms )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;Return Avg_Time_Interval&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//[Avg_Revisit_Interval]:&amp;nbsp; This is the one you can use to show revisit interval for individual as well as overall time interval (for KPI card)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Avg_Revisit_Interval = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;AVERAGEX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;ADDCOLUMNS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;VALUES( All_Platforms[User Name] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;"AvgTime", [AVG_Time_Revisit_Indv]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;[AVG_Time_Revisit_Indv]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//[Time_till_next_visit ]:&amp;nbsp; This is the measure you can use along with speciifc date which shows the number of dates till next visit. e.g. if you select the date when Emil visited, this measure will show the number of dates till Emil's next visit&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Time_till_next_visit = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR current_date = max(All_Platforms[OrderTime])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR Next_visit = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;min(All_Platforms[OrderTime]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;All_Platforms[OrderTime] &amp;gt; current_date)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;RETURN DATEDIFF(current_date,Next_visit,DAY)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//[Avg_Revist_Time_From]:&amp;nbsp; This is similar to above [Time_till_next_visit ] which you can use along with speciifc date. While&amp;nbsp;[Time_till_next_visit ] shows the number of dates till next visit, this measure show average number of dates for revisit calculating till last visit date. You need to create the measure [NumOfVisit] first to create this measure&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Avg_Revist_Time_From = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR current_date = max(All_Platforms[OrderTime])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR Fianl_visit = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MAX(All_Platforms[OrderTime]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;All_Platforms[OrderTime] &amp;gt; current_date)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR DateDifference = DATEDIFF(current_date,Fianl_visit,DAY)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;VAR Num_visit = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[NumOfVisit],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;All_Platforms[OrderTime] &amp;gt; current_date)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;RETURN DIVIDE( DateDifference,Num_visit)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please mark this as solution if this helped you.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 07 Oct 2021 09:05:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Customer-Repurchase-Cycle/m-p/2120924#M48599</guid>
      <dc:creator>colacan</dc:creator>
      <dc:date>2021-10-07T09:05:34Z</dc:date>
    </item>
  </channel>
</rss>

