<?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: Count where Rank=1 in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1513639#M29422</link>
    <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for a different view at the customers count. I tried to play with your suggestion, but couldn't make the Ranking work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Customers only works as a separate visual - if we add it to the table which includes Products (on columns for example) - it doesn't show the desired result (it shows 7 instead of 4). That could be the key to solving the Ranking problem I believe, but I couldn't make it work.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Nov 2020 11:40:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-24T11:40:49Z</dc:date>
    <item>
      <title>Count where Rank=1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1502076#M29057</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a way to make the following analysis work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a slicer with Product selection. When specific products are selected, I need one measure (#customers) to show the number of customers selling &lt;STRONG&gt;both products.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Also, I need another measure (CountRank1) to show in how many customers Product A sells better, and in how many Product B sells better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the screenshot with explanation below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The desired result is (also, for the measures to work on other visuals, not only the table)&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Product A&lt;/TD&gt;&lt;TD&gt;Product B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;VOL&lt;/TD&gt;&lt;TD&gt;510&lt;/TD&gt;&lt;TD&gt;536&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#customers&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CountRank1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the pbix sample file in the link below.&lt;/P&gt;&lt;P&gt;&lt;A href="https://gofile.io/d/0MQJ51" target="_blank" rel="noopener"&gt;https://gofile.io/d/0MQJ51&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would really appreciate any help - spent many hours on this and couldn't make it work.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 13:10:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1502076#M29057</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-18T13:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count where Rank=1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1502453#M29071</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , in rank you are using 'Prod_selection_1v1'[Product name], same should be used on visuals. &lt;/P&gt;
&lt;P&gt;In that case rank 1 count is coming 5,5 what seems right as there are 10 customers.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 15:20:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1502453#M29071</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-18T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count where Rank=1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1502483#M29078</link>
      <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue here is - I only need to compare customers which have &lt;STRONG&gt;both&lt;/STRONG&gt; products in their assortment. In others words, if at least one Product's VOL = 0, then dismiss this customer.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 15:32:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1502483#M29078</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-18T15:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Count where Rank=1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1505994#M29198</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;, I've so far only worked out how to count customers who sell all selected products; you might want to try a measure like this,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Customers = 
COUNTROWS (
    FILTER (
        DISTINCT ( Sales[Customer ID] ),
        COUNTROWS (
            CALCULATETABLE (
                EXCEPT ( DISTINCT ( Products[Product ID] ), DISTINCT ( Sales[Product ID] ) )
            )
        ) = 0
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Names = 
VAR __ids =
    FILTER (
        DISTINCT ( Sales[Customer ID] ),
        COUNTROWS (
            CALCULATETABLE (
                EXCEPT ( DISTINCT ( Products[Product ID] ), DISTINCT ( Sales[Product ID] ) )
            )
        ) = 0
    )
VAR __names =
    CALCULATETABLE (
        DISTINCT ( Customers[Customer name] ),
        CALCULATETABLE ( Sales, __ids )
    )
RETURN
    CONCATENATEX ( __names, Customers[Customer name], UNICHAR(10) )&lt;/LI-CODE&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;As to the rank part, it appears harder than expected. I'm also looking forward to solutions by others gurus.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 01:36:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1505994#M29198</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2020-11-20T01:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count where Rank=1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1513639#M29422</link>
      <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for a different view at the customers count. I tried to play with your suggestion, but couldn't make the Ranking work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Customers only works as a separate visual - if we add it to the table which includes Products (on columns for example) - it doesn't show the desired result (it shows 7 instead of 4). That could be the key to solving the Ranking problem I believe, but I couldn't make it work.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 11:40:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1513639#M29422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-24T11:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Count where Rank=1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1517324#M29551</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;, you might want to try new measures I authored again. (I attached &lt;A href="https://1drv.ms/u/s!AsDP3LYI8umsgTfRBhZWVfE9hbWL?e=AdDcmC" target="_blank" rel="noopener"&gt;&lt;EM&gt;&lt;STRONG&gt;a new file&lt;/STRONG&gt;&lt;/EM&gt;&lt;/A&gt; for it)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 21:27:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1517324#M29551</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2020-11-25T21:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count where Rank=1</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1519009#M29579</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That was it - I could make the CountRank1 work by recreating your '# Customers overlap' logic and inserting condition in there:&lt;/P&gt;&lt;P&gt;IF( [Product rank] = 1, [Product overlap] +0, 0 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks! Appreciate your help a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 14:00:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-where-Rank-1/m-p/1519009#M29579</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-26T14:00:59Z</dc:date>
    </item>
  </channel>
</rss>

