<?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: Count distinct customers having sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-customers-having-sales/m-p/845613#M6527</link>
    <description>&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1tneUjqd7rpk9dHkcjgodw2UNtQb41Roi/view?usp=sharing" target="_self"&gt;Hi,&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your syntax does not work as i expect.&lt;/P&gt;&lt;P&gt;You can see the raw data on this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1tneUjqd7rpk9dHkcjgodw2UNtQb41Roi/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1tneUjqd7rpk9dHkcjgodw2UNtQb41Roi/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In sheet "Raw", total customers in a month, 1 customer can purchase more than 1 time. When calculating active customers in a month, I use pivot to summarize sales by cust code then count 1 if sales by cust code in a month &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope its clear. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thx a lot!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2019 03:35:15 GMT</pubDate>
    <dc:creator>LinhDO</dc:creator>
    <dc:date>2019-11-14T03:35:15Z</dc:date>
    <item>
      <title>Count distinct customers having sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-customers-having-sales/m-p/844979#M6506</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I m new to Power BI and struggling with Power BI DAX.&lt;/P&gt;&lt;P&gt;I'm trying to count&amp;nbsp;&lt;STRONG&gt;Distinct customers having sales. &lt;/STRONG&gt;It means when selecting relevant months, only customers having sales will be counted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following measure:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"CALCULATE(DISTINCTCOUNT(Rawdata[cust code]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(Rawdata, CALCULATE(SUM(Rawdata[f_Value]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLEXCEPT(Rawdata,Rawdata[cust code]))&amp;gt;0))"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Error: It does not work with the condition "having sales &amp;gt; 0". For example, I select Oct 2019, it counts all distinct customers, including customers having sales &amp;lt; 0. I think the Filter function does not work, it just summerize the sales of customers of any time, not based on the months that I selected (ex Oct'19).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hope that you can help me on this issue.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks a lot in advance!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 14:03:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-customers-having-sales/m-p/844979#M6506</guid>
      <dc:creator>LinhDO</dc:creator>
      <dc:date>2019-11-13T14:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Count distinct customers having sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-customers-having-sales/m-p/845017#M6509</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="186007" data-lia-user-login="LinhDO" class="lia-mention lia-mention-user"&gt;LinhDO&lt;/a&gt;&amp;nbsp;Please use this measure. In case this is not what you expected, share some dummy data along with expected result&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; Measure = CALCULATE(DISTINCTCOUNT('Table'[cust code]),FILTER('Table','Table'[f_value]&amp;gt;0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 14:32:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-customers-having-sales/m-p/845017#M6509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-13T14:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count distinct customers having sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-customers-having-sales/m-p/845613#M6527</link>
      <description>&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1tneUjqd7rpk9dHkcjgodw2UNtQb41Roi/view?usp=sharing" target="_self"&gt;Hi,&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your syntax does not work as i expect.&lt;/P&gt;&lt;P&gt;You can see the raw data on this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1tneUjqd7rpk9dHkcjgodw2UNtQb41Roi/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1tneUjqd7rpk9dHkcjgodw2UNtQb41Roi/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In sheet "Raw", total customers in a month, 1 customer can purchase more than 1 time. When calculating active customers in a month, I use pivot to summarize sales by cust code then count 1 if sales by cust code in a month &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope its clear. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thx a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 03:35:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-customers-having-sales/m-p/845613#M6527</guid>
      <dc:creator>LinhDO</dc:creator>
      <dc:date>2019-11-14T03:35:15Z</dc:date>
    </item>
  </channel>
</rss>

