<?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: Slicer for a DISTINCTCOUNT metric in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2435544#M64985</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Maybe you can try just put it into filter pane and set the measure show itmes which is 1 or 2 or 10.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But if you want use slicer to control this number, a table contains all the number from 1 to max(distinctcount( contractID])) is necessary.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Create this table via this code below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;EM&gt;slicer = GENERATESERIES(1,DISTINCTCOUNT(Contracts[ContractID]))&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you need to create a measure named slicer for your visual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;slicer =
IF (
    [Contracts (by initial risk date)] &amp;gt;= MIN ( slicer[Value] )
        &amp;amp;&amp;amp; [Contracts (by initial risk date)] &amp;lt; = MAX ( 'slicer'[Value] ),
    1,
    0
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let it in filter pane on this visual and configure it show items is 1. Pbix file in the end you can refer.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 05:10:59 GMT</pubDate>
    <dc:creator>v-chenwuz-msft</dc:creator>
    <dc:date>2022-04-06T05:10:59Z</dc:date>
    <item>
      <title>Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2427686#M64523</link>
      <description>&lt;P&gt;Hello all&lt;BR /&gt;I hope everyone's ok, safe and healthy.&lt;BR /&gt;I have this simple measure that calculates the distinctcount of a contract, by a certain date&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Contracts (by initial risk date) = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'Contracts'[Contractid]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;Dates[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Contracts'[INRiskDate]&lt;/SPAN&gt;&lt;SPAN&gt;) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;My visual has all clients and the number of contracts for each&lt;BR /&gt;It works fine but now i would like to add filter with the number of contracts so i can choose the clients that has only 1 or 2 or 10 contracts&lt;BR /&gt;&lt;BR /&gt;Thanks a lot in advance&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 18:06:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2427686#M64523</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-03-30T18:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2428285#M64574</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt; , Try a meausre like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Client GT contract NO =&lt;BR /&gt;var _cnt = CALCULATE(&lt;BR /&gt;DISTINCTCOUNT ( 'Contracts'[Contractid]),&lt;BR /&gt;USERELATIONSHIP( Dates[Date],'Contracts'[INRiskDate]) ) &lt;BR /&gt;var _no =2 &lt;BR /&gt;return &lt;BR /&gt;countx(filter(summarize('Contracts',Clinet[client], "_1",_cnt),[_1] &amp;gt;= _no),[Clinet])&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 02:16:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2428285#M64574</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-31T02:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2429106#M64610</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&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;&amp;nbsp;&lt;BR /&gt;The first part it's clear that's my measure above.&lt;BR /&gt;Could you please explain the 2nd part, the countx?&lt;BR /&gt;For some reason it's not working and it shows me a value but i can't put it on a filter&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 09:36:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2429106#M64610</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-03-31T09:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2435544#M64985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Maybe you can try just put it into filter pane and set the measure show itmes which is 1 or 2 or 10.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But if you want use slicer to control this number, a table contains all the number from 1 to max(distinctcount( contractID])) is necessary.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Create this table via this code below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;EM&gt;slicer = GENERATESERIES(1,DISTINCTCOUNT(Contracts[ContractID]))&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you need to create a measure named slicer for your visual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;slicer =
IF (
    [Contracts (by initial risk date)] &amp;gt;= MIN ( slicer[Value] )
        &amp;amp;&amp;amp; [Contracts (by initial risk date)] &amp;lt; = MAX ( 'slicer'[Value] ),
    1,
    0
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let it in filter pane on this visual and configure it show items is 1. Pbix file in the end you can refer.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 05:10:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2435544#M64985</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-04-06T05:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2437795#M65124</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="320777" data-lia-user-login="v-chenwuz-msft" class="lia-mention lia-mention-user"&gt;v-chenwuz-msft&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Fantastic idea! It's working.&lt;BR /&gt;I had to change that Generateseries measure,&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;GENERATESERIES(1,MAX(Contracts[ContractID]))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and also took out the plus (+) sign.&lt;BR /&gt;One last question, from what i've seen and read, wouldn't it be better with SELECTEDVALUE?&lt;BR /&gt;Just asking because i wouldn't know how to do it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 10:10:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2437795#M65124</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-04-05T10:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2439616#M65260</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240828" data-lia-user-login="pedroccamaraDBI" class="lia-mention lia-mention-user"&gt;pedroccamaraDBI&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I apologize as I made some mistakes.&lt;/P&gt;
&lt;P&gt;Change "+" -&amp;gt; "=".&lt;/P&gt;
&lt;P&gt;Of course SELECTEDVALUE() works too, but you can only select one value instead of a range. If COUNTROWS(VALUES(slicer[Value])) &amp;gt; 1, then SELECTEDVALUE will get blank.&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;EM&gt;if(SELECTEDVALUE(slicer[Value]) = [Contracts (by initial risk date)],1,0)&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Apr 2022 05:19:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2439616#M65260</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-04-06T05:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2441516#M65386</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="320777" data-lia-user-login="v-chenwuz-msft" class="lia-mention lia-mention-user"&gt;v-chenwuz-msft&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You've been most helpfull&amp;nbsp;&lt;BR /&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 19:12:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2441516#M65386</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-04-06T19:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer for a DISTINCTCOUNT metric</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2446307#M65659</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="320777" data-lia-user-login="v-chenwuz-msft" class="lia-mention lia-mention-user"&gt;v-chenwuz-msft&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thank you very much for your help&lt;BR /&gt;It works perfectly&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 14:47:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slicer-for-a-DISTINCTCOUNT-metric/m-p/2446307#M65659</guid>
      <dc:creator>pedroccamaraDBI</dc:creator>
      <dc:date>2022-04-08T14:47:27Z</dc:date>
    </item>
  </channel>
</rss>

