title: Kusto Distinct Count
body: <p>I have written two queries below to extract distinct count/record from a table. However, both of them are giving me different results.</p>
  <p>The first query returns more records than the second query.</p>
  <p>query 1:</p>
  <pre><code>.ReachOptimization_L0
  | where CurrentSubscriptionStatus == &quot;ACTIVE&quot;| where SnapshotDate ==&quot;2019-11-29&quot;| where IsOptIn==1| where CampaignName != &quot;&quot;  or CampaignId != &quot;&quot;| where ReachedFlag== 1| summarize dcount(UserPUID)
  </code></pre>
  <p>query 2:</p>
  <pre><code>.ReachOptimization_L0| where CurrentSubscriptionStatus == &quot;ACTIVE&quot;| where SnapshotDate ==&quot;2019-11-29&quot;| where IsOptIn==1| where CampaignName != &quot;&quot;  or CampaignId != &quot;&quot;| where ReachedFlag== 1| distinct UserPUID
  </code></pre>