<?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 a Count of Customers that Own a Certain Number of Products in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3351881#M125873</link>
    <description>&lt;P&gt;Disregard this last msg from me,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;.&amp;nbsp; I made a couple of tweaks and got it to work!&amp;nbsp; Thanks for all of your help - would have never gotten there on my own!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2023 20:41:00 GMT</pubDate>
    <dc:creator>Blaggy</dc:creator>
    <dc:date>2023-07-26T20:41:00Z</dc:date>
    <item>
      <title>Need a Count of Customers that Own a Certain Number of Products</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3345751#M125624</link>
      <description>&lt;P&gt;I've been struggling with this, searching online, and I cannot seem to overcome this hurdle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm taking a list of customers that have Revenue in one or more of four products.&amp;nbsp; I have written the below DAX to create a measure for how many customers own each of the Products:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Product 1 Cust Count = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&g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IV&gt;&lt;SPAN&gt;and so on.&amp;nbsp; Then, I made a measure to show me the # of Products each customer has, called "Count of Products":&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count of Products = [Product 1 Cust Count]+[Product 2 Cust Count]+[Product 3 Cust Count]+[Product 4 Cust Count]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This works good when I add customers to a matrix by quarter, I can see the # of products each owns.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But, I cannot get over this last step, which seems like it should be simple.&amp;nbsp; I just want to create a measure that shows the number of customers that only own 1 product, the number of customers that own 2 products, etc. so that I can see the trends over time of how many customers own 1 product vs. 2 products vs. 3 products, etc.&amp;nbsp; I've tried this several ways, yet I don't get any results.&amp;nbsp; I've tried variations around something that looks like this (using customers that own 2 products as an example):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 Product Customers = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;[Customer]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;,Table[Count of Products]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I try to add this measure to a new visual, it just gives me blanks (no data), even though the DAX expression is not giving me any errors.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can someone suggest a better way of going about this (or where I'm going wrong above)?&amp;nbsp; I have a feeling I'm making this way harder than it should be.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:09:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3345751#M125624</guid>
      <dc:creator>Blaggy</dc:creator>
      <dc:date>2023-07-24T06:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Count of Customers that Own a Certain Number of Products</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3345804#M125628</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="463226" data-lia-user-login="Blaggy" class="lia-mention lia-mention-user"&gt;Blaggy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the proposed solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Product Count Parameter = 
SELECTCOLUMNS ( 
    GENERATESERIES ( 
        MINX ( VALUES ( Sales[CustomerKey] ), CALCULATE ( DISTINCTCOUNT ( Sales[ProductKey] ) ) ),
        MAXX ( VALUES ( Sales[CustomerKey] ), CALCULATE ( DISTINCTCOUNT ( Sales[ProductKey] ) ) ),
        1
    ),
    "Number of Products", [Value]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Number of Customers = 
COUNTROWS ( 
    FILTER ( 
        VALUES ( Sales[CustomerKey] ),
        CALCULATE ( DISTINCTCOUNT ( 'Sales'[ProductKey] ) ) = SELECTEDVALUE ( 'Product Count Parameter'[Number of Products] ) 
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:42:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3345804#M125628</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-07-24T06:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Count of Customers that Own a Certain Number of Products</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3347392#M125695</link>
      <description>&lt;P&gt;Thank you for this - gets me super close.&amp;nbsp; This is resulting in counts being slightly too high due to the fact that I want the product count to ignore any situations where the product is resulting in net negative sales (credit) - i.e. the Sales (or I guess "Net Price" using your example data) would need to be &amp;gt; 0.&amp;nbsp; Been trying to figure out where to weave that into your DAX, but I'm not good at DAX when it gets to this level!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate the quick response!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 20:59:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3347392#M125695</guid>
      <dc:creator>Blaggy</dc:creator>
      <dc:date>2023-07-24T20:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Count of Customers that Own a Certain Number of Products</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3349305#M125759</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, thank you again for your help.&amp;nbsp; I've been trying multiple different ways to filter-out any customers where revenue is not &amp;gt;0.&amp;nbsp; I'm sure it's very simple, but for the life of me, I cannot figure it out.&amp;nbsp; I'm horrible at DAX!&amp;nbsp; Could you let me know if you have a simple addition to your DAX that will achieve this?&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 17:36:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3349305#M125759</guid>
      <dc:creator>Blaggy</dc:creator>
      <dc:date>2023-07-25T17:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Count of Customers that Own a Certain Number of Products</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3350306#M125800</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="463226" data-lia-user-login="Blaggy" class="lia-mention lia-mention-user"&gt;Blaggy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;If you have the Revenue measure, you can use it in the filter as follows&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Number of Customers =
COUNTROWS (
    FILTER (
        VALUES ( Sales[CustomerKey] ),
        CALCULATE ( DISTINCTCOUNT ( 'Sales'[ProductKey] ) )
            = SELECTEDVALUE ( 'Product Count Parameter'[Number of Products] )
            &amp;amp;&amp;amp; [Revenue] &amp;gt; 0
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Jul 2023 06:44:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3350306#M125800</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-07-26T06:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Count of Customers that Own a Certain Number of Products</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3351680#M125863</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;.&amp;nbsp; Gets me closer, but not 100% correct.&amp;nbsp; What this is doing is pulling all of the customers with revenue &amp;lt;0 out of the first category.&amp;nbsp; For example, in the prior quarter, in my dataset, there were 3 customers with Revenue &amp;lt;0, but one of those was in the [Number of Products] = 1 category, one of those was in the&amp;nbsp;[Number of Products] = 2 category, and the other was in the&amp;nbsp;[Number of Products] = 3 category.&amp;nbsp; However, adding the "&amp;amp;&amp;amp; [Revenue] &amp;gt; 0" in that DAX takes all of those customers out of the&amp;nbsp;[Number of Products] = 1 category, which isn't correct.&amp;nbsp; Is there a different way to write this so that it ensures that it gets to the correct [Number of Products]?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again - getting SUPER close!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 17:54:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3351680#M125863</guid>
      <dc:creator>Blaggy</dc:creator>
      <dc:date>2023-07-26T17:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need a Count of Customers that Own a Certain Number of Products</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3351881#M125873</link>
      <description>&lt;P&gt;Disregard this last msg from me,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;.&amp;nbsp; I made a couple of tweaks and got it to work!&amp;nbsp; Thanks for all of your help - would have never gotten there on my own!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 20:41:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-a-Count-of-Customers-that-Own-a-Certain-Number-of-Products/m-p/3351881#M125873</guid>
      <dc:creator>Blaggy</dc:creator>
      <dc:date>2023-07-26T20:41:00Z</dc:date>
    </item>
  </channel>
</rss>

