<?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: DistinctCount with individual Rows Summing incorrectly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3695085#M143686</link>
    <description>&lt;P&gt;Use EXCEPT to weed out the extra member in New.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 01:06:43 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-02-13T01:06:43Z</dc:date>
    <item>
      <title>DistinctCount with individual Rows Summing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3694662#M143658</link>
      <description>&lt;P&gt;**Moderators, please remove the previous thread I created titled "&lt;SPAN class=""&gt;Totals not calculating correctly using SumX" as I have dug much deeper into this issue and realized the actual root of the problem.**&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I have concluded that my Matrix Table is calculating the correct amount of DistinctCount(MemberNumber) Total.&amp;nbsp; However, there is 1 MemberNumber that exists for both results "Existing" &amp;amp; "New" within the calculcated column.&amp;nbsp; Therefore, when my DAX is using DistinctCount for the entire column it gets the correct result of 468.&amp;nbsp; But, when it is using DistinctCount for each result "Existing" &amp;amp; "New" as separate rows, it's not seeing that overlapping MemberNumber and counts it as an additional DisctinctCount within the "New" row.&amp;nbsp; Please advise how to make each Row's filter/isolation take into account the entire Column's data.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Current DAX:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MemberNumberDISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(Heloc3MonthAdvances[TransactionDateMonth]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt; ( Heloc3MonthAdvances[MemberNumber] ))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;The end result should read:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Existing = 433&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;New = 35&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Total = 468&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;This is the current visual:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 18:42:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3694662#M143658</guid>
      <dc:creator>mclawler</dc:creator>
      <dc:date>2024-02-12T18:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount with individual Rows Summing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3695085#M143686</link>
      <description>&lt;P&gt;Use EXCEPT to weed out the extra member in New.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 01:06:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3695085#M143686</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-13T01:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount with individual Rows Summing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3695540#M143711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="511963" data-lia-user-login="mclawler" class="lia-mention lia-mention-user"&gt;mclawler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thank you very much for sharing!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a very suitable way, here I provide some specific code.&amp;nbsp;You can try the following code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MemberNumberDISTINCTCOUNT =
SUMX (
    VALUES ( Heloc3MonthAdvances[TransactionDateMonth] ),
    DISTINCTCOUNT ( Heloc3MonthAdvances[MemberNumber] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MemberNumberDISTINCTCOUNT_Existing =
CALCULATE (
    [MemberNumberDISTINCTCOUNT],
    Heloc3MonthAdvances[Result] = "Existing"
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MemberNumberDISTINCTCOUNT_New =
CALCULATE (
    [MemberNumberDISTINCTCOUNT],
    Heloc3MonthAdvances[Result] = "New",
    EXCEPT (
        VALUES ( Heloc3MonthAdvances[MemberNumber] ),
        CALCULATETABLE (
            VALUES ( Heloc3MonthAdvances[MemberNumber] ),
            Heloc3MonthAdvances[Result] = "Existing"
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should give you the results you want, which is 433 for "Existing" and 35 for "New".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/except-function-dax" target="_blank"&gt;EXCEPT function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 06:28:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3695540#M143711</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-13T06:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount with individual Rows Summing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3696887#M143761</link>
      <description>&lt;P&gt;Thank you for the reply I think you're on the right track but it's giving me blanks.&amp;nbsp; Currently I use a calculated column to generate the rows for Existing/New:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Existing/New =&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Heloc3MonthAdvances&lt;/SPAN&gt;&lt;SPAN&gt;[OpenDateMonth]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;Heloc3MonthAdvances&lt;/SPAN&gt;&lt;SPAN&gt;[TransactionDateMonth]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"Existing HELOC"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"New HELOC"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how to modify your code to adapt to my rows?&amp;nbsp; I have to keep my rows becuase in the same table I use other measures for $ Sum and YoY, MoM, etc... Thank you so much for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried these with no success:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MemberNumberDISTINCTCOUNT_Existing =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&g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lt;SPAN&gt;EXCEPT&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Heloc3MonthAdvances&lt;/SPAN&gt;&lt;SPAN&gt;[MemberNumber]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Heloc3MonthAdvances&lt;/SPAN&gt;&lt;SPAN&gt;[MemberNumber]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;Heloc3MonthAdvances&lt;/SPAN&gt;&lt;SPAN&gt;[Existing/New]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Existing"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:25:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3696887#M143761</guid>
      <dc:creator>mclawler</dc:creator>
      <dc:date>2024-02-13T16:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount with individual Rows Summing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3696889#M143762</link>
      <description>&lt;P&gt;Please see my reponse above, after reading what EXCEPT can do I believe you're right but can't figure out the proper code.&amp;nbsp; Please advise, and thank you for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:26:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3696889#M143762</guid>
      <dc:creator>mclawler</dc:creator>
      <dc:date>2024-02-13T16:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: DistinctCount with individual Rows Summing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3697073#M143768</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 18:09:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DistinctCount-with-individual-Rows-Summing-incorrectly/m-p/3697073#M143768</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-13T18:09:29Z</dc:date>
    </item>
  </channel>
</rss>

