<?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 Count distinct products where sum of sales are equal to zero in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-products-where-sum-of-sales-are-equal-to-zero/m-p/2572545#M73530</link>
    <description>&lt;P&gt;I want to&amp;nbsp;count the number of distinct products&amp;nbsp;where sum of sales are equal to zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product and sales query are related by product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sales query may not have all products so the product must come from the product query not from the sales query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couple of methods below have been tried and not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUMX(VALUES('Product'[Product Name]), IF(SUM(Sales[Amount]) = 0, 1))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE(COUNT('Product'[Product Name]), FILTER(ALL('Sales'), SUM(Sales[Amount]) = 0 ))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Product'[Product Name]&lt;/SPAN&gt;&lt;SPAN&gt; ),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;( 'Product'[Product Name] &lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales'[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;0&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2022 21:33:38 GMT</pubDate>
    <dc:creator>009co</dc:creator>
    <dc:date>2022-06-10T21:33:38Z</dc:date>
    <item>
      <title>Count distinct products where sum of sales are equal to zero</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-products-where-sum-of-sales-are-equal-to-zero/m-p/2572545#M73530</link>
      <description>&lt;P&gt;I want to&amp;nbsp;count the number of distinct products&amp;nbsp;where sum of sales are equal to zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product and sales query are related by product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sales query may not have all products so the product must come from the product query not from the sales query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couple of methods below have been tried and not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUMX(VALUES('Product'[Product Name]), IF(SUM(Sales[Amount]) = 0, 1))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE(COUNT('Product'[Product Name]), FILTER(ALL('Sales'), SUM(Sales[Amount]) = 0 ))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'Product'[Product Name]&lt;/SPAN&gt;&lt;SPAN&gt; ),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;( 'Product'[Product Name] &lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales'[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;0&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 21:33:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-products-where-sum-of-sales-are-equal-to-zero/m-p/2572545#M73530</guid>
      <dc:creator>009co</dc:creator>
      <dc:date>2022-06-10T21:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count distinct products where sum of sales are equal to zero</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-products-where-sum-of-sales-are-equal-to-zero/m-p/2572572#M73532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="311724" data-lia-user-login="009co" class="lia-mention lia-mention-user"&gt;009co&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How about this one here:&lt;/P&gt;&lt;PRE&gt;Measure = 
CALCULATE (
    DISTINCTCOUNT ( 'Product'[Product Name] ),
    FILTER (
        VALUES ( 'Product'[Product Name] ),
        CALCULATE ( SUM ( 'Sales'[Amount] ) ) = 0
    )
)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Let me know if this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 21:50:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-products-where-sum-of-sales-are-equal-to-zero/m-p/2572572#M73532</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2022-06-10T21:50:02Z</dc:date>
    </item>
  </channel>
</rss>

