<?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 Dynamic DAX Measure to Count Distinct Rows filtered by separate query in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-DAX-Measure-to-Count-Distinct-Rows-filtered-by-separate/m-p/4080338#M161977</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm pretty new to DAX and struggling to figure this out so any help is greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;I have the following data model (simplified):&lt;/P&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;I am trying to write a measure that runs a distinct count on the number of students ('Enrolment'[Student ID]) that have attended an appointment ('Appointments'[Attendance Status]=2). I then want to be able to slice on this measure by date, dimensions etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is currently giving me the correct total over all my data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Appointment Attendees (Distinct Students) = 
CALCULATE ( DISTINCTCOUNT('Enrolment'[Student ID]), 
FILTER(ALL('Appointments'), 'Appointments'[Attendance Status] = 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I have a number of other slicers in my report, drawing on values from fact and dim tables. These slicers are not working with the measure in the report , it only displays the original value.&lt;BR /&gt;&lt;BR /&gt;Is there a way to re-write the measure so it still works dynamically with slicers?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 07:56:00 GMT</pubDate>
    <dc:creator>jjfr</dc:creator>
    <dc:date>2024-08-05T07:56:00Z</dc:date>
    <item>
      <title>Dynamic DAX Measure to Count Distinct Rows filtered by separate query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-DAX-Measure-to-Count-Distinct-Rows-filtered-by-separate/m-p/4080338#M161977</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm pretty new to DAX and struggling to figure this out so any help is greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;I have the following data model (simplified):&lt;/P&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;I am trying to write a measure that runs a distinct count on the number of students ('Enrolment'[Student ID]) that have attended an appointment ('Appointments'[Attendance Status]=2). I then want to be able to slice on this measure by date, dimensions etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is currently giving me the correct total over all my data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Appointment Attendees (Distinct Students) = 
CALCULATE ( DISTINCTCOUNT('Enrolment'[Student ID]), 
FILTER(ALL('Appointments'), 'Appointments'[Attendance Status] = 2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I have a number of other slicers in my report, drawing on values from fact and dim tables. These slicers are not working with the measure in the report , it only displays the original value.&lt;BR /&gt;&lt;BR /&gt;Is there a way to re-write the measure so it still works dynamically with slicers?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 07:56:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-DAX-Measure-to-Count-Distinct-Rows-filtered-by-separate/m-p/4080338#M161977</guid>
      <dc:creator>jjfr</dc:creator>
      <dc:date>2024-08-05T07:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic DAX Measure to Count Distinct Rows filtered by separate query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-DAX-Measure-to-Count-Distinct-Rows-filtered-by-separate/m-p/4080359#M161979</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="745792" data-lia-user-login="jjfr" class="lia-mention lia-mention-user"&gt;jjfr&lt;/a&gt;&amp;nbsp;You use&amp;nbsp;&lt;STRONG&gt;ALL('Appointments')&amp;nbsp;&lt;/STRONG&gt;it kill effect of outer filter from &lt;STRONG&gt;same&lt;/STRONG&gt; &lt;STRONG&gt;table&lt;/STRONG&gt;(Appointments) and related &lt;STRONG&gt;expanded&lt;/STRONG&gt; table.&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Try below measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# Appointment Attendees (Distinct Students) = 
CALCULATE ( DISTINCTCOUNT('Enrolment'[Student ID]), 
FILTER(ALL('Appointments'[Attendance Status]), 'Appointments'[Attendance Status] = 2)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Dangar&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 08:07:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-DAX-Measure-to-Count-Distinct-Rows-filtered-by-separate/m-p/4080359#M161979</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-08-05T08:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic DAX Measure to Count Distinct Rows filtered by separate query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-DAX-Measure-to-Count-Distinct-Rows-filtered-by-separate/m-p/4080467#M161982</link>
      <description>&lt;P&gt;Brilliant thanks so much for that &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;! Works perfectly&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 08:29:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-DAX-Measure-to-Count-Distinct-Rows-filtered-by-separate/m-p/4080467#M161982</guid>
      <dc:creator>jjfr</dc:creator>
      <dc:date>2024-08-05T08:29:48Z</dc:date>
    </item>
  </channel>
</rss>

