<?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 calculates wrong with filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3988930#M154599</link>
    <description>&lt;P&gt;Guys!&lt;/P&gt;&lt;P&gt;I'm having some difficulty in the filter context for the DISTINCTCOUNT expression. When I apply a filter to the measurements, it presents incorrect data, but when I use SUM or COUNT, the data is presented correctly. Could anyone tell me why it doesn't work just for DISTINCTCOUNT.&lt;BR /&gt;&lt;BR /&gt;If I add the distinct counts, I don't get the total of 2,523 but rather 2,582. This difference only happens when I use the DISTINCTCOUNT expression. If you look at the second line of data, the sum is correct at 8,070, which I used COUNT.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Download file .pbix:&lt;/P&gt;&lt;P&gt;&lt;A title="File PBIX" href="https://drive.google.com/file/d/1k9jMKQ_EFLTmJOpQAzAQdfAp3ipzgWSN/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1k9jMKQ_EFLTmJOpQAzAQdfAp3ipzgWSN/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 16:48:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-12T16:48:43Z</dc:date>
    <item>
      <title>DISTINCTCOUNT calculates wrong with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3988930#M154599</link>
      <description>&lt;P&gt;Guys!&lt;/P&gt;&lt;P&gt;I'm having some difficulty in the filter context for the DISTINCTCOUNT expression. When I apply a filter to the measurements, it presents incorrect data, but when I use SUM or COUNT, the data is presented correctly. Could anyone tell me why it doesn't work just for DISTINCTCOUNT.&lt;BR /&gt;&lt;BR /&gt;If I add the distinct counts, I don't get the total of 2,523 but rather 2,582. This difference only happens when I use the DISTINCTCOUNT expression. If you look at the second line of data, the sum is correct at 8,070, which I used COUNT.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Download file .pbix:&lt;/P&gt;&lt;P&gt;&lt;A title="File PBIX" href="https://drive.google.com/file/d/1k9jMKQ_EFLTmJOpQAzAQdfAp3ipzgWSN/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1k9jMKQ_EFLTmJOpQAzAQdfAp3ipzgWSN/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 16:48:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3988930#M154599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-12T16:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT calculates wrong with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3989002#M154603</link>
      <description>&lt;P&gt;Thanks for the pbix.&lt;/P&gt;
&lt;P&gt;Can you explain a bit more about what we need to investigate? I see 2 rows of visuals.&amp;nbsp; Where is the error or wrong data displayed?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 14:58:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3989002#M154603</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2024-06-12T14:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT calculates wrong with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3989240#M154627</link>
      <description>&lt;P&gt;If I add the distinct counts, I don't get the total of 2,523 but rather 2,582. This difference only happens when I use the DISTINCTCOUNT expression. If you look at the second line of data, the sum is correct at 8,070, which I used COUNT.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 16:48:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3989240#M154627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-12T16:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT calculates wrong with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3989627#M154687</link>
      <description>&lt;P&gt;There are 2523 distinct values in the whole dataset for COD.&amp;nbsp; There is overlap of COD in the different Filter categories.&lt;/P&gt;
&lt;P&gt;One example is for COD = 106.&amp;nbsp; There are rows for Filter = LT and rows for Filter = Na e LT.&lt;/P&gt;
&lt;P&gt;So these values will be included in the distinctcount for [&lt;SPAN&gt;Total Count LT] and [&lt;/SPAN&gt;&lt;SPAN&gt;Total Count NA e LT] &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but they will only count as 1 in the [Total].&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So the [Total] measure is accurate and the individual distinctcount measures are also accurate but the [Total] will be less &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;than adding up the individual measures.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:57:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-calculates-wrong-with-filter/m-p/3989627#M154687</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2024-06-12T21:57:51Z</dc:date>
    </item>
  </channel>
</rss>

