<?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 DISTINCTCOUNT exclude sum of negative and zero sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1269940#M21376</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate a number of Total /New customer.&lt;/P&gt;&lt;P&gt;I have a cancelled (negative) sales in my sales data.&lt;/P&gt;&lt;P&gt;but I would like to sum positive&amp;nbsp;and negative by customer and if negative or zero I do not want to count it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Customers = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DISTINCTCOUNT(SalesData[customer]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SalesData,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUM(SalesData[Sales])&amp;gt;0 &amp;amp;&amp;amp; SalesData[customer]&amp;lt;&amp;gt;blank()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would like&amp;nbsp; to make my result like following.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://drive.google.com/drive/folders/1eQKNHKmBodPbQy0v-fGVBIEDx3TM4A0n?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/drive/folders/1eQKNHKmBodPbQy0v-fGVBIEDx3TM4A0n?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 04 Aug 2020 01:42:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-04T01:42:47Z</dc:date>
    <item>
      <title>DISTINCTCOUNT exclude sum of negative and zero sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1269940#M21376</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate a number of Total /New customer.&lt;/P&gt;&lt;P&gt;I have a cancelled (negative) sales in my sales data.&lt;/P&gt;&lt;P&gt;but I would like to sum positive&amp;nbsp;and negative by customer and if negative or zero I do not want to count it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Customers = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DISTINCTCOUNT(SalesData[customer]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SalesData,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUM(SalesData[Sales])&amp;gt;0 &amp;amp;&amp;amp; SalesData[customer]&amp;lt;&amp;gt;blank()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would like&amp;nbsp; to make my result like following.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;A href="https://drive.google.com/drive/folders/1eQKNHKmBodPbQy0v-fGVBIEDx3TM4A0n?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/drive/folders/1eQKNHKmBodPbQy0v-fGVBIEDx3TM4A0n?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Aug 2020 01:42:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1269940#M21376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-04T01:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT exclude sum of negative and zero sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1269976#M21377</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try like&lt;/P&gt;
&lt;P&gt;Total Customers =&lt;BR /&gt;countX(filter(summarize(SalesData, SalesData[customer],"_1",SUM(SalesData[Sales])+0),SUM(SalesData[Sales])&amp;gt;0 &amp;amp;&amp;amp; not(isblank([customer]))),[customer])&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 02:02:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1269976#M21377</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-04T02:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT exclude sum of negative and zero sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270072#M21379</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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but did not change.&lt;/P&gt;&lt;P&gt;It shows same number.&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 02:49:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270072#M21379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-04T02:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT exclude sum of negative and zero sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270130#M21380</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , Try like&lt;/P&gt;
&lt;P&gt;Total Customers =&lt;BR /&gt;countX(filter(summarize(SalesData, SalesData[customer],"_1",SUM(SalesData[Sales])+0),[_1]&amp;gt;0 &amp;amp;&amp;amp; not(isblank([customer]))),[customer])&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;Total Customers =&lt;BR /&gt;countX(filter(summarize(SalesData, SalesData[customer],"_1",SUM(SalesData[Sales])+0 ,"_2", calculate(SUM(SalesData[Sales])+0, allexcept(Table[Store]))),[_2]&amp;gt;0 &amp;amp;&amp;amp; not(isblank([customer]))),[customer])&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 03:10:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270130#M21380</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-04T03:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT exclude sum of negative and zero sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270238#M21389</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;Try this blog to understand new customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blog.enterprisedna.co/calculate-the-total-of-new-clients-youre-onboarding-every-month-advanced-dax/" target="_blank"&gt;https://blog.enterprisedna.co/calculate-the-total-of-new-clients-youre-onboarding-every-month-advanced-dax/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 05:16:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270238#M21389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-04T05:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT exclude sum of negative and zero sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270989#M21406</link>
      <description>First, you have to know how to calculate the measures without your condition correctly. To know this please navigate to &lt;A href="http://www.sqlbi.com" target="_blank"&gt;www.sqlbi.com&lt;/A&gt; and look for articles on "returning customers" via the search box at the top of the page. Then, you'll need to modify the calculation a bit to factor in your condition.</description>
      <pubDate>Tue, 04 Aug 2020 09:27:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-exclude-sum-of-negative-and-zero-sales/m-p/1270989#M21406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-04T09:27:18Z</dc:date>
    </item>
  </channel>
</rss>

