<?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: Knowing The Number Of Days Between 1st or Nth Orders for different customers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540842#M30321</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check the measure below posted by&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; , the problem I don't know how to call it, did you get the point?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Assuming that there's:&lt;BR /&gt;// 1. a Customers dimension,&lt;BR /&gt;// 3. a Dates dimension (for the order dates),&lt;BR /&gt;// 4. an Orders fact table.&lt;BR /&gt;// The Orders fact (*-side) joins to Dates[Date]&lt;BR /&gt;// dimension (1-side) on Orders[OrderDate] and to&lt;BR /&gt;// Customers[CustomerID] on Orders[CustomerID].&lt;BR /&gt;// Orders must also have a column [Order No]&lt;BR /&gt;// which will number orders (within each customer)&lt;BR /&gt;// from 1 to N. All the ID columns in the fact table&lt;BR /&gt;// and dimensions will, of course, be hidden.&lt;BR /&gt;// The very last N available for a customer will,&lt;BR /&gt;// of course, be different among customers as one&lt;BR /&gt;// can't reasonably expect that all customers have&lt;BR /&gt;// placed the exact number of orders. Once this&lt;BR /&gt;// setup is in place, you can write a measure that will&lt;BR /&gt;// return the average number of days between [Order No] = n&lt;BR /&gt;// [Order No] = n+1 (all within the current context!).&lt;/P&gt;&lt;P&gt;[Avg No of Days To Next Order] =&lt;BR /&gt;// First, need to make sure that the column&lt;BR /&gt;// Orders[Order No] is filtered. If there's&lt;BR /&gt;// a filter on [Order No] = 1, then we'll be&lt;BR /&gt;// calculating the average num of days between&lt;BR /&gt;// the order numbers 1 and 2. If there's a filter&lt;BR /&gt;// on order number 10, the measure will return&lt;BR /&gt;// the avg number of days between order number&lt;BR /&gt;// 10 and 11 and so on...&lt;BR /&gt;if( hasonefilter( Orders[Order No] ),&lt;/P&gt;&lt;P&gt;var __orderNumber = selectedvalue( Orders[Order No] )&lt;BR /&gt;var __avg =&lt;BR /&gt;averagex(&lt;BR /&gt;Orders,&lt;BR /&gt;// For the current order find the next one&lt;BR /&gt;// (within the same customer AND THE CURRENT&lt;BR /&gt;// CONTEXT!) and caclulate the difference in&lt;BR /&gt;// the order dates.&lt;BR /&gt;var __currentOrderDate = Orders[OrderDate]&lt;BR /&gt;return&lt;BR /&gt;calculate(&lt;BR /&gt;// Get the next order for the same&lt;BR /&gt;// customer if there exists such an&lt;BR /&gt;// order. If not, BLANK will be returned&lt;BR /&gt;// and hence such a customer will not&lt;BR /&gt;// participate in the calculation of&lt;BR /&gt;// the average, as required. Please note&lt;BR /&gt;// that this calculation fully respects&lt;BR /&gt;// the current context, so based on the&lt;BR /&gt;// filters there might not be an (n+1)th&lt;BR /&gt;// order for the customer, even though it&lt;BR /&gt;// will exist in a modified (broader) context.&lt;BR /&gt;var __nextOrderDate =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SELECTEDVALUE( Orders[OrderDate], BLANK() ),&lt;BR /&gt;Orders[Order No] = __orderNumber + 1&lt;BR /&gt;)&lt;BR /&gt;return&lt;BR /&gt;DATEDIFF(&lt;BR /&gt;__currentOrderDate,&lt;BR /&gt;__nextOrderDate,&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;return&lt;BR /&gt;__avg&lt;BR /&gt;&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2020 12:11:29 GMT</pubDate>
    <dc:creator>MAAbdullah_47</dc:creator>
    <dc:date>2020-12-09T12:11:29Z</dc:date>
    <item>
      <title>Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1526368#M29882</link>
      <description>&lt;P&gt;Dear Experts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I need to know the Average Number of days Between Order (n) and Order (n+1) for all customers not for Particuler Customer here is an example:&lt;/P&gt;&lt;P&gt;Assuming&amp;nbsp; we have (175) customers they have a range of orders requested BTW (1 - n) orders, we need only Up to (10) Orders Maximum to calculate the average No of Days BTW (1-10) as the following:&lt;BR /&gt;From Ordder No&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;To&amp;nbsp; Order No&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; No Of Customers&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Average No Of Days BTW Orders&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22.3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 70&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 33.3&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 65&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10.7&lt;BR /&gt;,&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15.3&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I attached PBix Sample with this thread.&lt;BR /&gt;&lt;BR /&gt;&lt;A title="Pbix File Sample" href="https://drive.google.com/file/d/1PRJZRipQ5n_RYGUwFRe1zMpZqri-7wdV/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1PRJZRipQ5n_RYGUwFRe1zMpZqri-7wdV/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 11:56:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1526368#M29882</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-01T11:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529342#M29978</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Assuming that there's:
// 1. a Customers dimension,
// 3. a Dates dimension (for the order dates),
// 4. an Orders fact table.
// The Orders fact (*-side) joins to Dates[Date]
// dimension (1-side) on Orders[OrderDate] and to
// Customers[CustomerID] on Orders[CustomerID].
// Orders must also have a column [Order No]
// which will number orders (within each customer)
// from 1 to N. All the ID columns in the fact table
// and dimensions will, of course, be hidden.
// The very last N available for a customer will, 
// of course, be different among customers as one
// can't reasonably expect that all customers have
// placed the exact number of orders. Once this 
// setup is in place, you can write a measure that will
// return the average number of days between [Order No] = n
// [Order No] = n+1 (all within the current context!).

[Avg No of Days To Next Order] =
// First, need to make sure that the column
// Orders[Order No] is filtered. If there's
// a filter on [Order No] = 1, then we'll be
// calculating the average num of days between
// the order numbers 1 and 2. If there's a filter
// on order number 10, the measure will return
// the avg number of days between order number
// 10 and 11 and so on...
if( hasonefilter( Orders[Order No] ),

    var __orderNumber = selectedvalue( Orders[Order No] )
    var __avg =
        averagex(
            Orders,
            // For the current order find the next one
            // (within the same customer AND THE CURRENT
            // CONTEXT!) and caclulate the difference in
            // the order dates.
            var __currentOrderDate = Orders[OrderDate]
            return
            calculate(
                // Get the next order for the same
                // customer if there exists such an
                // order. If not, BLANK will be returned
                // and hence such a customer will not
                // participate in the calculation of
                // the average, as required. Please note
                // that this calculation fully respects
                // the current context, so based on the
                // filters there might not be an (n+1)th
                // order for the customer, even though it
                // will exist in a modified (broader) context.
                var __nextOrderDate =
                    CALCULATE(
                        SELECTEDVALUE( Orders[OrderDate], BLANK() ),
                        Orders[Order No] = __orderNumber + 1
                    )
                return
                    DATEDIFF(
                        __currentOrderDate, 
                        __nextOrderDate,
                        DAY
                    )
                )
            )
        )
    return
        __avg
        
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 17:40:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529342#M29978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-02T17:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529413#M29980</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; thank you for your post , let me test it and get back to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 18:21:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529413#M29980</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-02T18:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529420#M29981</link>
      <description>&lt;P&gt;I have question&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; you wrote ("On order 10 measure will return")&lt;/P&gt;&lt;P&gt;which line on the measure mentions this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 18:24:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529420#M29981</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-02T18:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529424#M29982</link>
      <description>&lt;P&gt;How we display the # customers on each of the 10 rows?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 18:26:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1529424#M29982</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-02T18:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1530715#M30022</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives the error below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The order number is Text not Number.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 10:12:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1530715#M30022</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-03T10:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1530727#M30023</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you consider the Order Number as Numerice , Please check the pbix file attached and assest me in impleminting it on the attached pbix file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 10:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1530727#M30023</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-03T10:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1531460#M30063</link>
      <description>&lt;P&gt;From the code it's obvious that if the code does something like a - 1, then it must be numeric or a date, depending on the context, since you can't mix data types in DAX. It's obvious as well that Order No must be numeric. Your initial post shows them as numeric, too. To see the number of customers the average is calculated against you have to create a separate measure taking mine as a template. I can't view the file you placed a link to because my company does not allow this. Hence I gave you a description of a correct model in the header of my measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"I have question&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/239341" target="_blank"&gt;@daxer&lt;/A&gt;&amp;nbsp; you wrote ("On order 10 measure will return")&lt;/P&gt;&lt;P&gt;which line on the measure mentions this?"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure works on ANY selection of Order No. Your question is not comprehensible to me. Sorry.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 16:05:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1531460#M30063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-03T16:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1531476#M30065</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that you checked the attached file, the (1,2,.....etc) not means the order number (In the order table) it means (The 1st order of the customer , the 2nd order of the customer,.....etc, 10th order for the customer) , did you know what I means?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 16:18:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1531476#M30065</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-03T16:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1531500#M30067</link>
      <description>&lt;P&gt;Mate, this is exactly what it means in my code&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":pouting_face:"&gt;😡&lt;/span&gt; Please read this once again with a focus. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 16:34:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1531500#M30067</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-03T16:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1534565#M30143</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; again, can you show me at least how to call the measure above?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 06:59:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1534565#M30143</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-06T06:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1537985#M30242</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="7987" data-lia-user-login="Member123456" class="lia-mention lia-mention-user"&gt;Member123456&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still I didn't get the solution , let me know what do you think , Mr.&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; appreciating his initiative for helping but he not welling in adding further assitance , I tried his solution it is not working because the order number is string , he told me you have to call the measure , I ask him how to call the measure but he never respond.&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 12:29:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1537985#M30242</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-08T12:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540423#M30307</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="106465" data-lia-user-login="MAAbdullah_47" class="lia-mention lia-mention-user"&gt;MAAbdullah_47&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you provide an example based on the actual data that you have in your file with the expected result?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please click &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help other members find it useful&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.excelfort.com" target="_blank"&gt;&lt;FONT color="blue"&gt;Website&lt;/FONT&gt;&lt;/A&gt; &lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 09:15:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540423#M30307</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-12-09T09:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540446#M30308</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the expected output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note the Order No means the series of the order here is an example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Order Number&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Series&lt;BR /&gt;-----------------&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ----&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;D&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;N&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 09:22:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540446#M30308</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-09T09:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540582#M30311</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="106465" data-lia-user-login="MAAbdullah_47" class="lia-mention lia-mention-user"&gt;MAAbdullah_47&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please read my comments. You need to provide an example using the data that is in the attachment you shared.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please click &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help other members find it useful&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.excelfort.com" target="_blank"&gt;&lt;FONT color="blue"&gt;Website&lt;/FONT&gt;&lt;/A&gt; &lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 09:58:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540582#M30311</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-12-09T09:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540824#M30318</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp; I need that out put, I don't have it in the (pbix) file, I need measures to achive this&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please back to the earliest discussion with Mr.&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; he send me a measure to do this but I need to call this measure that calculate the average days BTW 2 Orders but the problem I don't know how to call this measure , I did post asking for your help to achive the results.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 12:05:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540824#M30318</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-09T12:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540842#M30321</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check the measure below posted by&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; , the problem I don't know how to call it, did you get the point?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Assuming that there's:&lt;BR /&gt;// 1. a Customers dimension,&lt;BR /&gt;// 3. a Dates dimension (for the order dates),&lt;BR /&gt;// 4. an Orders fact table.&lt;BR /&gt;// The Orders fact (*-side) joins to Dates[Date]&lt;BR /&gt;// dimension (1-side) on Orders[OrderDate] and to&lt;BR /&gt;// Customers[CustomerID] on Orders[CustomerID].&lt;BR /&gt;// Orders must also have a column [Order No]&lt;BR /&gt;// which will number orders (within each customer)&lt;BR /&gt;// from 1 to N. All the ID columns in the fact table&lt;BR /&gt;// and dimensions will, of course, be hidden.&lt;BR /&gt;// The very last N available for a customer will,&lt;BR /&gt;// of course, be different among customers as one&lt;BR /&gt;// can't reasonably expect that all customers have&lt;BR /&gt;// placed the exact number of orders. Once this&lt;BR /&gt;// setup is in place, you can write a measure that will&lt;BR /&gt;// return the average number of days between [Order No] = n&lt;BR /&gt;// [Order No] = n+1 (all within the current context!).&lt;/P&gt;&lt;P&gt;[Avg No of Days To Next Order] =&lt;BR /&gt;// First, need to make sure that the column&lt;BR /&gt;// Orders[Order No] is filtered. If there's&lt;BR /&gt;// a filter on [Order No] = 1, then we'll be&lt;BR /&gt;// calculating the average num of days between&lt;BR /&gt;// the order numbers 1 and 2. If there's a filter&lt;BR /&gt;// on order number 10, the measure will return&lt;BR /&gt;// the avg number of days between order number&lt;BR /&gt;// 10 and 11 and so on...&lt;BR /&gt;if( hasonefilter( Orders[Order No] ),&lt;/P&gt;&lt;P&gt;var __orderNumber = selectedvalue( Orders[Order No] )&lt;BR /&gt;var __avg =&lt;BR /&gt;averagex(&lt;BR /&gt;Orders,&lt;BR /&gt;// For the current order find the next one&lt;BR /&gt;// (within the same customer AND THE CURRENT&lt;BR /&gt;// CONTEXT!) and caclulate the difference in&lt;BR /&gt;// the order dates.&lt;BR /&gt;var __currentOrderDate = Orders[OrderDate]&lt;BR /&gt;return&lt;BR /&gt;calculate(&lt;BR /&gt;// Get the next order for the same&lt;BR /&gt;// customer if there exists such an&lt;BR /&gt;// order. If not, BLANK will be returned&lt;BR /&gt;// and hence such a customer will not&lt;BR /&gt;// participate in the calculation of&lt;BR /&gt;// the average, as required. Please note&lt;BR /&gt;// that this calculation fully respects&lt;BR /&gt;// the current context, so based on the&lt;BR /&gt;// filters there might not be an (n+1)th&lt;BR /&gt;// order for the customer, even though it&lt;BR /&gt;// will exist in a modified (broader) context.&lt;BR /&gt;var __nextOrderDate =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SELECTEDVALUE( Orders[OrderDate], BLANK() ),&lt;BR /&gt;Orders[Order No] = __orderNumber + 1&lt;BR /&gt;)&lt;BR /&gt;return&lt;BR /&gt;DATEDIFF(&lt;BR /&gt;__currentOrderDate,&lt;BR /&gt;__nextOrderDate,&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;return&lt;BR /&gt;__avg&lt;BR /&gt;&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 12:11:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1540842#M30321</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-09T12:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1541065#M30329</link>
      <description>&lt;P&gt;Here's a link to a PBI report that implements a solution. You should very carefully examine the file and the formulas to understand how it all works. Be especially careful to understand relative and absolute Order Sequence Numbers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!ApyQEauTSLtOgY9D2FS2kAShjQvcww?e=lV4Vee" target="_blank" rel="noopener"&gt;https://1drv.ms/u/s!ApyQEauTSLtOgY9D2FS2kAShjQvcww?e=lV4Vee&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 14:08:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1541065#M30329</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2020-12-09T14:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1541354#M30345</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255913" data-lia-user-login="daxer-almighty" class="lia-mention lia-mention-user"&gt;daxer-almighty&lt;/a&gt;&amp;nbsp; I'm appreciating your help let me examin the solution carefully and get back to you as soon as I understand the complete picture , thank you my friend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 16:08:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1541354#M30345</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-09T16:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Knowing The Number Of Days Between 1st or Nth Orders for different customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1541356#M30346</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255913" data-lia-user-login="daxer-almighty" class="lia-mention lia-mention-user"&gt;daxer-almighty&lt;/a&gt;&amp;nbsp; One question How you bring the (AbsoluteOrderSeqNo) to Orders I mean this column is it calculated colomn or what is it exactly ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 16:14:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Knowing-The-Number-Of-Days-Between-1st-or-Nth-Orders-for/m-p/1541356#M30346</guid>
      <dc:creator>MAAbdullah_47</dc:creator>
      <dc:date>2020-12-09T16:14:43Z</dc:date>
    </item>
  </channel>
</rss>

