<?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: COUNTROWS with ALL and data selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2381090#M61533</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;Can you show me the expected result based on the sample data you have write above?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BF&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2022 11:08:20 GMT</pubDate>
    <dc:creator>BeaBF</dc:creator>
    <dc:date>2022-03-08T11:08:20Z</dc:date>
    <item>
      <title>COUNTROWS with ALL and data selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2380981#M61523</link>
      <description>&lt;P&gt;Hi experts!&lt;/P&gt;&lt;P&gt;I use a simple COUNTROWS Measur to count the number of weeks with a value below a target:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;COUNTROWS(FILTER(ALL(Dates[Week]), [Sales] &amp;lt; 500))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a slicer in the same visual to display just a specific month or quarter but since there is ALL in the function, this is not working.&lt;/P&gt;&lt;P&gt;How can I get the number of weeks always for the selected date range?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calendar Table&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Week&lt;/TD&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.01.2022&lt;/TD&gt;&lt;TD&gt;01&lt;/TD&gt;&lt;TD&gt;Jan&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02.01.2022&lt;/TD&gt;&lt;TD&gt;01&lt;/TD&gt;&lt;TD&gt;Jan&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Transactional Table&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Article&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.01.2022&lt;/TD&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.01.2022&lt;/TD&gt;&lt;TD&gt;ABCD&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 08 Mar 2022 10:43:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2380981#M61523</guid>
      <dc:creator>joshua1990</dc:creator>
      <dc:date>2022-03-08T10:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTROWS with ALL and data selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2380990#M61526</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;Hi!&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;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Dates[Week]&lt;/SPAN&gt;&lt;SPAN&gt;), [Sales] &amp;lt; 500,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Dates[Week]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;BF&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Mar 2022 10:24:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2380990#M61526</guid>
      <dc:creator>BeaBF</dc:creator>
      <dc:date>2022-03-08T10:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTROWS with ALL and data selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2380996#M61528</link>
      <description>&lt;P&gt;Thanks, but this measure will not work. COUNTROWS allows just tables, not columns&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 10:25:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2380996#M61528</guid>
      <dc:creator>joshua1990</dc:creator>
      <dc:date>2022-03-08T10:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTROWS with ALL and data selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2381003#M61530</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;so use COUNT, why do you need to use COUNTROWS? Can't you count the rows of the entire table?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be easier if you paste some sample data and show the result you would like to get&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BF&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 10:28:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2381003#M61530</guid>
      <dc:creator>BeaBF</dc:creator>
      <dc:date>2022-03-08T10:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTROWS with ALL and data selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2381036#M61531</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="202311" data-lia-user-login="BeaBF" class="lia-mention lia-mention-user"&gt;BeaBF&lt;/a&gt;&amp;nbsp;: please find in the initial post the structure of the tables. Works COUNT if you have multiple rows with the same week?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 10:44:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2381036#M61531</guid>
      <dc:creator>joshua1990</dc:creator>
      <dc:date>2022-03-08T10:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTROWS with ALL and data selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2381090#M61533</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;Can you show me the expected result based on the sample data you have write above?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BF&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 11:08:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2381090#M61533</guid>
      <dc:creator>BeaBF</dc:creator>
      <dc:date>2022-03-08T11:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: COUNTROWS with ALL and data selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2391382#M62213</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;1)&lt;/P&gt;
&lt;LI-CODE lang="ruby"&gt;measure =
COUNTROWS ( FILTER ( ALLSELECTED ( Dates[Week] ), [Sales] &amp;lt; 500 ) )
&lt;/LI-CODE&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;LI-CODE lang="ruby"&gt;measure =
COUNTROWS (
    SUMMARIZE (
        CALCULATETABLE ( 'Calendar Table', 'Transactional Table'[Sales] &amp;lt; 500 ),
        [Week]
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Zeon Zheng&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 07:14:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNTROWS-with-ALL-and-data-selection/m-p/2391382#M62213</guid>
      <dc:creator>v-angzheng-msft</dc:creator>
      <dc:date>2022-03-14T07:14:30Z</dc:date>
    </item>
  </channel>
</rss>

