<?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 of Students that exist in all terms selected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3843388#M150250</link>
    <description>&lt;P&gt;=VAR _terms=ALLSELECTED(&lt;SPAN&gt;'dw vw_Exec_Course_Performance'[Term]) RETURN&amp;nbsp;&lt;/SPAN&gt;COUNTROWS(FILTER(VALUES(&lt;SPAN&gt;'dw vw_Exec_Course_Performance'[StudentID]),ISEMPTY(EXCEPT(_terms,CALCULATTABLE(VALUES('dw vw_Exec_Course_Performance'[Term]))))))&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2024 04:54:50 GMT</pubDate>
    <dc:creator>wdx223_Daniel</dc:creator>
    <dc:date>2024-04-17T04:54:50Z</dc:date>
    <item>
      <title>Count of Students that exist in all terms selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3842807#M150231</link>
      <description>&lt;P&gt;I have a datasource with Student information.&amp;nbsp; I'd like to count the unique students that exist in all selected terms.&amp;nbsp; I have a test calculation that kind-of works.&amp;nbsp; The correct answer is 2 but my report gives me 2 for all races that I add.&amp;nbsp; I need the calculation to only show results for the students of each race/gender who have records in all terms.&lt;BR /&gt;Here's my DAX code and the results I'm getting.&amp;nbsp; In this example, only Student 11111 should be counted.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Term_Cnt_F = &lt;/SPAN&gt;&lt;SPAN&gt;CONVERT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;('dw vw_Exec_Course_Performance'[Term])&lt;BR /&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;('dw vw_Exec_Course_Performance') )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;('dw vw_Exec_Course_Performance'[StudentID])&lt;BR /&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;('dw vw_Exec_Course_Performance')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;,'dw vw_Exec_Course_Performance'[StudentID]=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('dw vw_Exec_Course_Performance'[StudentID])&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;)) ,INTEGER)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;Thanks to anyone who can help me with this!!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Apr 2024 23:55:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3842807#M150231</guid>
      <dc:creator>SHullen</dc:creator>
      <dc:date>2024-04-16T23:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count of Students that exist in all terms selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3843388#M150250</link>
      <description>&lt;P&gt;=VAR _terms=ALLSELECTED(&lt;SPAN&gt;'dw vw_Exec_Course_Performance'[Term]) RETURN&amp;nbsp;&lt;/SPAN&gt;COUNTROWS(FILTER(VALUES(&lt;SPAN&gt;'dw vw_Exec_Course_Performance'[StudentID]),ISEMPTY(EXCEPT(_terms,CALCULATTABLE(VALUES('dw vw_Exec_Course_Performance'[Term]))))))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 04:54:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3843388#M150250</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2024-04-17T04:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Count of Students that exist in all terms selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3843917#M150262</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="535828" data-lia-user-login="SHullen" class="lia-mention lia-mention-user"&gt;SHullen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from&amp;nbsp;wdx223_Daniel&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this modified measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Term_Cnt_F =
VAR SelectedTermsCount = DISTINCTCOUNT('dw vw_Exec_Course_Performance'[Term])
VAR StudentsInAllTerms =
     CALCULATETABLE(
         SUMMARIZE(
             'dw vw_Exec_Course_Performance',
             'dw vw_Exec_Course_Performance'[StudentID],
             "TermsCount", CALCULATE(DISTINCTCOUNT('dw vw_Exec_Course_Performance'[Term]))
         ),
         ALLSELECTED('dw vw_Exec_Course_Performance')
     )
RETURN
COUNTROWS(
     FILTER(
         StudentsInAllTerms,
         [TermsCount] = SelectedTermsCount
     )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Is this correct?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only select 11111 it looks like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pbix file is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would be grateful if you could provide me with sample data for testing, please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&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;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 06:26:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3843917#M150262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-17T06:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count of Students that exist in all terms selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3844619#M150278</link>
      <description>&lt;P&gt;Thank you so much Daniel!!!&amp;nbsp; This works perfectly as expected.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 08:28:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3844619#M150278</guid>
      <dc:creator>SHullen</dc:creator>
      <dc:date>2024-04-17T08:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Count of Students that exist in all terms selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3844635#M150280</link>
      <description>&lt;P&gt;Thank you so much for responding!!&amp;nbsp; Daniel's code worked perfectly as I needed it to but I will review your code when I have a chance.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 08:31:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-Students-that-exist-in-all-terms-selected/m-p/3844635#M150280</guid>
      <dc:creator>SHullen</dc:creator>
      <dc:date>2024-04-17T08:31:55Z</dc:date>
    </item>
  </channel>
</rss>

