<?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: Distinct Count If Rows are duplicate in certains conditions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967235#M11483</link>
    <description>It should have work with both filter and unfiltered conditions.&lt;BR /&gt;&lt;BR /&gt;What do you mean by not showing right behaviour?&lt;BR /&gt;Thanks,&lt;BR /&gt;Pravin&lt;BR /&gt;</description>
    <pubDate>Tue, 10 Mar 2020 16:42:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-10T16:42:15Z</dc:date>
    <item>
      <title>Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/965677#M11443</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, I have a table like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Category1&lt;/TD&gt;&lt;TD&gt;Client&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Distinct Count of Client&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Distinct Count of Client only if Category1 has different values&lt;/P&gt;&lt;P&gt;2 (because Client 1 ans 4 has A and B values)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using DAX, how can I achieve this??&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 22:00:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/965677#M11443</guid>
      <dc:creator>felipevaz</dc:creator>
      <dc:date>2020-03-09T22:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/965929#M11448</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="126812" data-lia-user-login="felipevaz" class="lia-mention lia-mention-user"&gt;felipevaz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this should do what you want:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Distinct Count of Client only if Category1 has different values = 
COUNTROWS ( 
    FILTER ( 
        VALUES ( YourTable[Client] ),
        CALCULATE ( DISTINCTCOUNT( YourTable[Category1] ) ) &amp;gt; 1
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 02:42:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/965929#M11448</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2020-03-10T02:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/966633#M11463</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="126812" data-lia-user-login="felipevaz" class="lia-mention lia-mention-user"&gt;felipevaz&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Distinct Count of Client=DistinctCount(table[Client])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Distinct Count of Client only if Category1 has different values=Sumx(Summerize(table,table[Client],"Count",DistinctCount(table[Category1])),if([Count]&amp;gt;1,1,0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Drag above measures in seperate card visuals.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Pravin Wattamwar&lt;BR /&gt;&lt;A href="http://www.linkedin.com/in/pravin-p-wattamwar" target="_blank"&gt;www.linkedin.com/in/pravin-p-wattamwar&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If I resolve your problem Mark it as a solution and give kudos.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 11:24:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/966633#M11463</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-10T11:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/966992#M11471</link>
      <description>Thank you Wattamwar&lt;BR /&gt;&lt;BR /&gt;It works well, but when I need to filter the Category1 the measure does not represent the right behavior. Like, if I select Category1 = A the measure does not distinct count the cases.&lt;BR /&gt;&lt;BR /&gt;May I use booth cases in the same measure?&lt;BR /&gt;Distinct count Client by A cases OR&lt;BR /&gt;Distinct count Client by B cases OR&lt;BR /&gt;Distinct count Client by AB cases OR&lt;BR /&gt;Distinct count Client independently&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Mar 2020 15:05:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/966992#M11471</guid>
      <dc:creator>felipevaz</dc:creator>
      <dc:date>2020-03-10T15:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/966993#M11472</link>
      <description>Thank you Owen&lt;BR /&gt;&lt;BR /&gt;It works well, but when I need to filter the Category1 the measure does not represent the right behavior. Like, if I select Category1 = A the measure does not distinct count the cases.&lt;BR /&gt;&lt;BR /&gt;May I use booth cases in the same measure?&lt;BR /&gt;Distinct count Client by A cases OR&lt;BR /&gt;Distinct count Client by B cases OR&lt;BR /&gt;Distinct count Client by AB cases OR&lt;BR /&gt;Distinct count Client independently</description>
      <pubDate>Tue, 10 Mar 2020 15:06:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/966993#M11472</guid>
      <dc:creator>felipevaz</dc:creator>
      <dc:date>2020-03-10T15:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967173#M11481</link>
      <description>&lt;P&gt;Let me reintroduce the question...also include a new dimension here to better explains the context&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Category1&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Client&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;02/01/2020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;02/01/2020&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The distinct count has to change if the dimensions are filtered, like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 1) Distinct count of Client = 4&lt;/P&gt;&lt;P&gt;Case 2) Distinct count of Client in 01/01/2020 = 3&lt;/P&gt;&lt;P&gt;Case 3) Distinct count of Client that has both A and B category = 2&lt;/P&gt;&lt;P&gt;Case 4) Distinct count of Client in 01/01/2020 that has both A and B category = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to measure the distinct count if Category1 has no filter, if the Client has A and B or if the Client has A OR B value...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can it be done in one measure?? Using diferent dimensions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry my english, it is not thaaat good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 16:03:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967173#M11481</guid>
      <dc:creator>felipevaz</dc:creator>
      <dc:date>2020-03-10T16:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967235#M11483</link>
      <description>It should have work with both filter and unfiltered conditions.&lt;BR /&gt;&lt;BR /&gt;What do you mean by not showing right behaviour?&lt;BR /&gt;Thanks,&lt;BR /&gt;Pravin&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Mar 2020 16:42:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967235#M11483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-10T16:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967250#M11484</link>
      <description>&lt;P&gt;Pravin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;values=Sumx(Summerize(table,table[Client],"Count",DistinctCount(table[Category1])),if([Count]&amp;gt;1,1,0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is returning &lt;STRONG&gt;2&lt;/STRONG&gt; if the "Client" has "A" &lt;STRONG&gt;and&amp;nbsp;&lt;/STRONG&gt;"B" values at the same time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is not the total number of distinct Clients...is &lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Category1&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Client&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;02/01/2020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;02/01/2020&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;01/01/2020&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The distinct count has to change if the dimensions are filtered, like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 1) Distinct count of Client = 4&lt;/P&gt;&lt;P&gt;Case 2) Distinct count of Client in 01/01/2020 = 3&lt;/P&gt;&lt;P&gt;Case 3) Distinct count of Client that has both A and B category = 2&lt;/P&gt;&lt;P&gt;Case 4) Distinct count of Client in 01/01/2020 that has both A and B category = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to measure the distinct count if Category1 has no filter, if the Client has A and B or if the Client has A OR B value...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can it be done in one measure?? Using diferent dimensions?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 16:55:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967250#M11484</guid>
      <dc:creator>felipevaz</dc:creator>
      <dc:date>2020-03-10T16:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967601#M11499</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="126812" data-lia-user-login="felipevaz" class="lia-mention lia-mention-user"&gt;felipevaz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just reading your replies, are you wanting a measure that behaves differently depending on whether certain filters are applied? That is certainly possible using functions like ISFILTERED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you want a measure that:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;In certain cases returns regular distinct count&lt;/LI&gt;&lt;LI&gt;In other cases returns distinct count of clients with multiple Category1 values?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Both my and&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;'s measures posted earlier return option 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you clarify in which cases you want option 1 &amp;amp; option 2?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 21:06:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967601#M11499</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2020-03-10T21:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count If Rows are duplicate in certains conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967789#M11510</link>
      <description>Where are you applying measure?&lt;BR /&gt;Is it in card or table itself?&lt;BR /&gt;&lt;BR /&gt;And where are applying filter&lt;BR /&gt;Is it in slicer ?&lt;BR /&gt;&lt;BR /&gt;If you are taking date column in slicer and the measures in card..value of measure will change with selected date in slicer.&lt;BR /&gt;&lt;BR /&gt;I hve given two measures one is for distinctcount of clients.&lt;BR /&gt;Other one is distinctcount of clients have both a and b.&lt;BR /&gt;&lt;BR /&gt;Both measures value will get change with filteres.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Pravin</description>
      <pubDate>Wed, 11 Mar 2020 02:13:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-If-Rows-are-duplicate-in-certains-conditions/m-p/967789#M11510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-11T02:13:25Z</dc:date>
    </item>
  </channel>
</rss>

