<?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: Using the pickup date to rank orderid and sub-orderid as rank 1 in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026361#M103211</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;here's a sample table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The goal is to mark all customers with LAPTOP in their first order, be it main order or sub-order id.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 15:54:33 GMT</pubDate>
    <dc:creator>Andrew_na_lang</dc:creator>
    <dc:date>2023-01-17T15:54:33Z</dc:date>
    <item>
      <title>Using the pickup date to rank orderid and sub-orderid as rank 1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026068#M103194</link>
      <description>&lt;P&gt;In my orders table, I have the &lt;STRONG&gt;order_id&lt;/STRONG&gt; and a &lt;STRONG&gt;sub-order id&lt;/STRONG&gt;&amp;nbsp;created if the customer has sent a Laptop along with his/her Mobile which is our main service. Both orders have the exact pickup date, but different order_ID.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need to know whether the first order of all our customers has a laptop included. I did order ranking through this DAX formula:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;Order Ranking 1 = &lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;VAR _currentcustomer = Orders[customer_id]&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;VAR _newtable =&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; FILTER (&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Orders,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Orders[customer_id] = _currentcustomer )&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;VAR _rankingresult =&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; RANKX ( _newtable, orders[time_pickup_id].[Date],, ASC )&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;RETURN&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;&lt;STRONG&gt;_rankingresult&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;All sub-order id shows as second order being sub-order id, hence, I am unable to extract the accurate number of first orders with a laptop.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I was told that I could use the pickup date as a parameter to rank both order_id and sub-order id as rank 1 so that I could pull up the right number. I don't know how to do it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need help!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My customer table has a one-to-many relationship with my orders table.&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Jan 2023 14:28:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026068#M103194</guid>
      <dc:creator>Andrew_na_lang</dc:creator>
      <dc:date>2023-01-17T14:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using the pickup date to rank orderid and sub-orderid as rank 1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026237#M103201</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="364063" data-lia-user-login="Andrew_na_lang" class="lia-mention lia-mention-user"&gt;Andrew_na_lang&lt;/a&gt; ,&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any blank value, not sure why you are getting rank as 2&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 15:19:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026237#M103201</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-17T15:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using the pickup date to rank orderid and sub-orderid as rank 1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026361#M103211</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;here's a sample table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The goal is to mark all customers with LAPTOP in their first order, be it main order or sub-order id.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 15:54:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026361#M103211</guid>
      <dc:creator>Andrew_na_lang</dc:creator>
      <dc:date>2023-01-17T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using the pickup date to rank orderid and sub-orderid as rank 1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026407#M103217</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="364063" data-lia-user-login="Andrew_na_lang" class="lia-mention lia-mention-user"&gt;Andrew_na_lang&lt;/a&gt; , Try like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RANKX ( Filter(Orders, Orders[customer_id] = earlier(Orders[customer_id]) &amp;amp;&amp;amp; [Laptop_contribution] =0 &amp;amp;&amp;amp; not(isblank([Laptop_contribution] )) ), orders[time_pickup_id].[Date],, ASC )&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 16:05:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026407#M103217</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-17T16:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using the pickup date to rank orderid and sub-orderid as rank 1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026724#M103242</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;it didn't work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Maybe I asked the question wrong.&amp;nbsp;&lt;BR /&gt;How about how can I filter the orders table where if order rank 1 and order rank 2 have the same pickup date, then sum the laptop contribution?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 18:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-the-pickup-date-to-rank-orderid-and-sub-orderid-as-rank-1/m-p/3026724#M103242</guid>
      <dc:creator>Andrew_na_lang</dc:creator>
      <dc:date>2023-01-17T18:30:30Z</dc:date>
    </item>
  </channel>
</rss>

