<?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 DAX function to count values not duplicated in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3748616#M146209</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a report for a wharehouse to check what is inside, what was removed and what has entered.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to focus on what was removed from one day to another and exclude what entered. Below there's the structure of the table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; //&amp;nbsp; Package&amp;nbsp; // Dwell&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;03/05/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03/05/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03/05/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt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lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On March 5th there were 5 packages on the wharehouse and on March 6th there were also 5 packages, but packages 4 and 5 were removed and packages 6 and 7 have entered. The final result I want to find is 3 (number of packages that remained from one day to another removing the packages with Dwell=0 because they're new)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2024 11:01:40 GMT</pubDate>
    <dc:creator>marquesj</dc:creator>
    <dc:date>2024-03-07T11:01:40Z</dc:date>
    <item>
      <title>DAX function to count values not duplicated</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3748616#M146209</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a report for a wharehouse to check what is inside, what was removed and what has entered.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to focus on what was removed from one day to another and exclude what entered. Below there's the structure of the table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; //&amp;nbsp; Package&amp;nbsp; // Dwell&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;03/05/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03/05/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;T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;TR&gt;&lt;TD&gt;03/06/2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On March 5th there were 5 packages on the wharehouse and on March 6th there were also 5 packages, but packages 4 and 5 were removed and packages 6 and 7 have entered. The final result I want to find is 3 (number of packages that remained from one day to another removing the packages with Dwell=0 because they're new)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 11:01:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3748616#M146209</guid>
      <dc:creator>marquesj</dc:creator>
      <dc:date>2024-03-07T11:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: DAX function to count values not duplicated</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3749544#M146248</link>
      <description>&lt;P&gt;COUNTROWS(INTERSECT())&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 19:28:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3749544#M146248</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-07T19:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX function to count values not duplicated</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3750595#M146281</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="693074" data-lia-user-login="marquesj" class="lia-mention lia-mention-user"&gt;marquesj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;1. Create a calculated column to get the data retained from the previous day.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _pre = CALCULATE(COUNT('Table'[Package]),FILTER(ALL('Table'),'Table'[Date Dwell] = EARLIER('Table'[Date Dwell]) - 1 &amp;amp;&amp;amp; 'Table'[Package ] = EARLIER('Table'[Package ])))
RETURN
_pre&lt;/LI-CODE&gt;
&lt;P&gt;2. Create a calculated column to get the count of retained packages from the previous day.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column 2 =
VAR _cou = CALCULATE(SUM('Table'[Column]),FILTER(ALL('Table'), 'Table'[Column] &amp;lt;&amp;gt; BLANK() &amp;amp;&amp;amp;'Table'[Date Dwell] = EARLIER('Table'[ Date Dwell])))
RETURN
IF('Table'[Column] &amp;lt;&amp;gt; BLANK(),_cou,BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;3. If you want to view the retained data, you can filter out the data whose calculated column is not empty in the filters pane, as shown in the figure below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Clara Gong&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 06:32:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3750595#M146281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-08T06:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX function to count values not duplicated</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3751351#M146318</link>
      <description>&lt;P&gt;Hi Clara,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for helping out. Reading again my topic, I have made some confusion. The result I'm looking for is 2, as packages 4 and 5 were removed and therefore don't duplicate from one day to another.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this way I'll be given the opposite result that I need. The result I'm looking for is 2 as packages 4 and 5 were the ones that were removed:&amp;nbsp;&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;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 12:20:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3751351#M146318</guid>
      <dc:creator>marquesj</dc:creator>
      <dc:date>2024-03-08T12:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: DAX function to count values not duplicated</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3751648#M146327</link>
      <description>&lt;P&gt;COUNTROWS()-COUNTROWS(EXCEPT())&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 14:53:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3751648#M146327</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-08T14:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: DAX function to count values not duplicated</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3754389#M146473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="693074" data-lia-user-login="marquesj" class="lia-mention lia-mention-user"&gt;marquesj&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;1. The expression of column 2 can be modified as:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column 2 =
IF('Table'[Column] = BLANK(),1,BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;2. Create a calculated column to count new values.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column 3 =
VAR _cou = CALCULATE(SUM('Table'[Column 2]),FILTER(ALL('Table'), 'Table'[Column 2] &amp;lt;&amp;gt; BLANK()&amp;amp;&amp;amp;'Table'[Date Dwell] = EARLIER('Table '[Date Dwell]) ))
RETURN
IF('Table'[Column 2] &amp;lt;&amp;gt; BLANK(),_cou,BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;3. The final result is shown in the figure below. All data are displayed on March 5 because there is no previous date for comparison, so all data are considered new.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Clara Gong&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 08:09:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3754389#M146473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-11T08:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX function to count values not duplicated</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3755037#M146508</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 seems that isn't working. Dwell days are not contemplated and it's counting only the unique packages of day 6/03. If I manually put the filter on the visual for "Dwell = 0" I'm left with very few results which don't match the reality&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 11:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-function-to-count-values-not-duplicated/m-p/3755037#M146508</guid>
      <dc:creator>marquesj</dc:creator>
      <dc:date>2024-03-11T11:57:45Z</dc:date>
    </item>
  </channel>
</rss>

