<?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 Only count a order the first time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2696852#M81413</link>
    <description>&lt;P&gt;Maybe there is an easy fix to this problem, that i just havent been able to figure out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to count order numbers on a specific date, but i only want to count the order number once, and it has to be the first time it appears. So if order number 213, have date 31/01/2022, and there is another entry on order number 213, on date 24/02/2022. I only want it to be counted the first time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it make sense, and there is a fix to it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2022 07:39:57 GMT</pubDate>
    <dc:creator>Wengel</dc:creator>
    <dc:date>2022-08-12T07:39:57Z</dc:date>
    <item>
      <title>Only count a order the first time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2696852#M81413</link>
      <description>&lt;P&gt;Maybe there is an easy fix to this problem, that i just havent been able to figure out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to count order numbers on a specific date, but i only want to count the order number once, and it has to be the first time it appears. So if order number 213, have date 31/01/2022, and there is another entry on order number 213, on date 24/02/2022. I only want it to be counted the first time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it make sense, and there is a fix to it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 07:39:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2696852#M81413</guid>
      <dc:creator>Wengel</dc:creator>
      <dc:date>2022-08-12T07:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Only count a order the first time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2697085#M81428</link>
      <description>&lt;P&gt;You could create a calculated column to store the first order date and then link that to your Date table instead of, or as well as, linking the existing order date column.&lt;/P&gt;&lt;P&gt;The new column could be something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;First order date = CALCULATE( MIN('Sales'[Order date]), ALLEXCEPT('Sales', 'Sales'[Order ID]) )&lt;/LI-CODE&gt;&lt;P&gt;and your number of orders measure would be either a simple DISTINCTCOUNT or a DISTINCTCOUNT with USERELATIONSHIP if you have multiple relationships from Date to Sales.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:35:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2697085#M81428</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-08-12T09:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Only count a order the first time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2704383#M81970</link>
      <description>&lt;P&gt;Awesome solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the same problem in here and this solutions tends to solve at least 85% of the situation..&lt;/P&gt;&lt;P&gt;But i have another doubt:&lt;BR /&gt;&lt;BR /&gt;In this dax function created to find the min(value), is there anyway to get the min(value) that has another condition?&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;ID | Date | Status&lt;BR /&gt;1--|10/01| ERROR&lt;BR /&gt;2--|11/01| ACCEPTED&lt;BR /&gt;3--|13/01| ACCEPTED&lt;BR /&gt;4--|18/01| ERROR&lt;BR /&gt;&lt;BR /&gt;If i apply the query itself, it will return me the ID 1, since it has the min value, but instead, i would like to get the ID 2, since it is the min value accepted..&lt;BR /&gt;&lt;BR /&gt;This question makes any sense? Sorry for any inconvenience &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 20:41:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2704383#M81970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-16T20:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Only count a order the first time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2704443#M81974</link>
      <description>&lt;P&gt;I got myself reading documentation and found the solution!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;FIRST VALUE ACCEPTED =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Status]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"ACCEPTED"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;BR /&gt;ALLEXCEPT(Table,Table[Id])&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Aug 2022 21:06:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2704443#M81974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-16T21:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Only count a order the first time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2711224#M82380</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="358021" data-lia-user-login="Wengel" class="lia-mention lia-mention-user"&gt;Wengel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag =
IF(
    MAX('Table'[Date])=MINX(FILTER(ALL('Table'),'Table'[ID]=MAX('Table'[ID])),[Date]),1,0)&lt;/LI-CODE&gt;
&lt;P&gt;2. Place [Flag]in Filters, set is=1, apply filter.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 01:31:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Only-count-a-order-the-first-time/m-p/2711224#M82380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-19T01:31:05Z</dc:date>
    </item>
  </channel>
</rss>

