<?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 shows 1 when it is 0 in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3449702#M131365</link>
    <description>&lt;P&gt;I have added a Card to my PowerBI report that shows how many distinct customers are matched, per Reason code. I have 8 lines for 4 customers. so with no filters the card shows 4, which is correct. If I filter on Reason=Material, the card shows 3, which is also correct. And when Reason=Process, the card shows one, which is also correct. If I exclude Material and Process from the filter, the card should show 0, but shows 1. Why??? And more importantly, how do I fix it?&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;/*CountOfMatched = DISTINCTCOUNT(Table[Customer])+0*/&lt;/P&gt;&lt;PRE&gt;CountOfMatched for Reason Material = 3 (correct)&lt;BR /&gt;CountOfMatched for Process = 1 (correct)&lt;BR /&gt;CountOfMatched for none of them = 0 but the visual shows 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2023 12:10:41 GMT</pubDate>
    <dc:creator>Cadenze</dc:creator>
    <dc:date>2023-09-27T12:10:41Z</dc:date>
    <item>
      <title>DistinctCount shows 1 when it is 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3449702#M131365</link>
      <description>&lt;P&gt;I have added a Card to my PowerBI report that shows how many distinct customers are matched, per Reason code. I have 8 lines for 4 customers. so with no filters the card shows 4, which is correct. If I filter on Reason=Material, the card shows 3, which is also correct. And when Reason=Process, the card shows one, which is also correct. If I exclude Material and Process from the filter, the card should show 0, but shows 1. Why??? And more importantly, how do I fix it?&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;/*CountOfMatched = DISTINCTCOUNT(Table[Customer])+0*/&lt;/P&gt;&lt;PRE&gt;CountOfMatched for Reason Material = 3 (correct)&lt;BR /&gt;CountOfMatched for Process = 1 (correct)&lt;BR /&gt;CountOfMatched for none of them = 0 but the visual shows 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 12:10:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3449702#M131365</guid>
      <dc:creator>Cadenze</dc:creator>
      <dc:date>2023-09-27T12:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount shows 1 when it is 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3452741#M131553</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="505459" data-lia-user-login="Cadenze" class="lia-mention lia-mention-user"&gt;Cadenze&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please try to create a measure with below dax formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count of Matched =
IF ( ISFILTERED ( 'Table'[Reason] ), DISTINCTCOUNT ( 'Table'[Customer] ), 0 )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the attached .pbix file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_Binbin Yu&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 02:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3452741#M131553</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-29T02:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount shows 1 when it is 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3452921#M131564</link>
      <description>&lt;P&gt;What a cool way to present a solution - thank you! It works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 06:34:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3452921#M131564</guid>
      <dc:creator>Cadenze</dc:creator>
      <dc:date>2023-09-29T06:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount shows 1 when it is 0</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3658226#M141741</link>
      <description>&lt;P&gt;Hi, I had the same issue when I was trying to use the data directly from Salesforce. I was wondering if there is a formula for Salesforce Data in this case? And it's filtered by Company name for example from the data source (Salesforce Reports). Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 22:28:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-shows-1-when-it-is-0/m-p/3658226#M141741</guid>
      <dc:creator>cotswoldclass</dc:creator>
      <dc:date>2024-01-24T22:28:35Z</dc:date>
    </item>
  </channel>
</rss>

