<?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: Need Help with DAX formula to count Distinct for order numbers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1970130#M43251</link>
    <description>&lt;P&gt;Hi Samarth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking time to help me.&lt;BR /&gt;&lt;BR /&gt;If I add another Order No that has only Type A, my expected output should be.&lt;/P&gt;&lt;P&gt;TypeA - 2&lt;/P&gt;&lt;P&gt;TypeB - 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggested formula still shows, TypeA - 1 and TypeB - 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to display order numbers that have Only Type A or only Type B. I don't want to count Order numbers that have Both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you understood my expected output.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jul 2021 09:23:33 GMT</pubDate>
    <dc:creator>GomzeeR</dc:creator>
    <dc:date>2021-07-21T09:23:33Z</dc:date>
    <item>
      <title>Need Help with DAX formula to count Distinct for order numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969883#M43234</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set, where an order number can have either one or multiple lines associated with it.&lt;/P&gt;&lt;P&gt;Ex:&lt;BR /&gt;OrderNO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&lt;BR /&gt;12345&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/P&gt;&lt;P&gt;12345&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;12346 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/P&gt;&lt;P&gt;12347 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;12348 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/P&gt;&lt;P&gt;12348 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I want to count all the order numbers that have either Type A or Type B only. I &lt;STRONG&gt;don't&lt;/STRONG&gt; want to count Order numbers that have both Type A &amp;amp; Type B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably this is quite simple, but I am unable to achieve it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gowtham&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 09:28:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969883#M43234</guid>
      <dc:creator>GomzeeR</dc:creator>
      <dc:date>2021-07-21T09:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with DAX formula to count Distinct for order numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969933#M43235</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="203867" data-lia-user-login="GomzeeR" class="lia-mention lia-mention-user"&gt;GomzeeR&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use below code:-&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Unique_count =
COUNTROWS (
    SUMMARIZE ( 'Table (2)', 'Table (2)'[OrderNO     ], 'Table (2)'[Type] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below would be output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hope you wanted the same output if not please share the expected output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Samarth&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 07:21:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969933#M43235</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2021-07-21T07:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with DAX formula to count Distinct for order numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969944#M43236</link>
      <description>&lt;P&gt;Hi Samarth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a count for Type A to be 1 and Type B to be 1(From the example data).&lt;BR /&gt;Count of Type A(unique) = 1&lt;BR /&gt;Count of Type B(Unique) = 1&lt;BR /&gt;&lt;BR /&gt;I want to count only rows that has either A or B not both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gowtham&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 07:28:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969944#M43236</guid>
      <dc:creator>GomzeeR</dc:creator>
      <dc:date>2021-07-21T07:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with DAX formula to count Distinct for order numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969957#M43239</link>
      <description>&lt;P&gt;=countrows(filter(values(table[order no]),calculate(distinctcount(table[type]))=1))&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 07:32:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969957#M43239</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2021-07-21T07:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with DAX formula to count Distinct for order numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969998#M43242</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;This formula is not working for me, I need to measure count for rows that has Type A only(which is one in the sample data). Same for Type B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gowtham&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 07:51:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1969998#M43242</guid>
      <dc:creator>GomzeeR</dc:creator>
      <dc:date>2021-07-21T07:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with DAX formula to count Distinct for order numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1970038#M43245</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="203867" data-lia-user-login="GomzeeR" class="lia-mention lia-mention-user"&gt;GomzeeR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try below code it will help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Unique_count = 
COUNTROWS (
    FILTER (
        VALUES ( 'Table (2)'[Type] ),
        CALCULATE ( DISTINCTCOUNT ( 'Table (2)'[OrderNO     ] ) &amp;gt; 1 )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:-&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 08:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1970038#M43245</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2021-07-21T08:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with DAX formula to count Distinct for order numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1970130#M43251</link>
      <description>&lt;P&gt;Hi Samarth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking time to help me.&lt;BR /&gt;&lt;BR /&gt;If I add another Order No that has only Type A, my expected output should be.&lt;/P&gt;&lt;P&gt;TypeA - 2&lt;/P&gt;&lt;P&gt;TypeB - 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggested formula still shows, TypeA - 1 and TypeB - 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to display order numbers that have Only Type A or only Type B. I don't want to count Order numbers that have Both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you understood my expected output.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 09:23:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-with-DAX-formula-to-count-Distinct-for-order-numbers/m-p/1970130#M43251</guid>
      <dc:creator>GomzeeR</dc:creator>
      <dc:date>2021-07-21T09:23:33Z</dc:date>
    </item>
  </channel>
</rss>

