<?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 total number with out the join in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3543914#M136249</link>
    <description>&lt;P&gt;I am receiving an error that Allexcept needs to be within the same table, I can't use different tables in the argument&lt;/P&gt;</description>
    <pubDate>Tue, 21 Nov 2023 07:06:10 GMT</pubDate>
    <dc:creator>maramassaf</dc:creator>
    <dc:date>2023-11-21T07:06:10Z</dc:date>
    <item>
      <title>Count total number with out the join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3543755#M136233</link>
      <description>&lt;P&gt;I have three tables&amp;nbsp;&lt;BR /&gt;Schools with the campus name&lt;BR /&gt;Teacher with the teacher name and location&lt;BR /&gt;Observation with the teacher name and campus. I am joining these three tables together to get the number of observation per teacher/campus/school. I am using slicer to filter for each value. Now I want to calculate the total number of teachers in each campus and school&amp;nbsp;&lt;BR /&gt;Ex. Campus 1 Boys School 20 teachers&lt;BR /&gt;Campus 2 Girls School 30 teachers and so on....&lt;BR /&gt;I am trying to do a distinctcount on teachers table but if the teacher is not in the observation table then it will not be counted because of the Join as it's returning only teachers in both table.&amp;nbsp;&lt;BR /&gt;How can i do that?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 05:12:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3543755#M136233</guid>
      <dc:creator>maramassaf</dc:creator>
      <dc:date>2023-11-21T05:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count total number with out the join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3543783#M136237</link>
      <description>&lt;P&gt;&lt;SPAN&gt;If you want to count the total number of teachers in each campus and school, regardless of whether they have observations or not, you can use a combination of &lt;/SPAN&gt;COUNTROWS&lt;SPAN&gt; and &lt;/SPAN&gt;CALCULATE&lt;SPAN&gt; functions in DAX (Data Analysis Expressions). Assuming you have a relationship between the Teachers table and the Observations table, you can create a new measure to count the distinct number of teachers. Here's an example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TotalTeachers =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;VALUES(Teachers[TeacherName])&lt;BR /&gt;),&lt;BR /&gt;ALL(Observations)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure uses the CALCULATE function to create a context transition and temporarily remove any filters applied to the Observations table. Then, it uses COUNTROWS and VALUES functions to count the distinct number of teachers in the Teachers table.&lt;/P&gt;&lt;P&gt;Now, you can use this measure in your report alongside the other columns to display the total number of teachers for each campus and school. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TotalTeachersPerCampusSchool =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[TotalTeachers],&lt;BR /&gt;ALLEXCEPT(Observations, Schools[CampusName], Schools[SchoolName])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this measure, ALLEXCEPT is used to remove all filters from the Observations table except for the ones related to CampusName and SchoolName from the Schools table. This way, the total number of teachers is calculated based on the selected campus and school.&lt;/P&gt;&lt;P&gt;Please adjust the table and column names in the DAX formulas based on your actual data model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 05:37:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3543783#M136237</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-11-21T05:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count total number with out the join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3543914#M136249</link>
      <description>&lt;P&gt;I am receiving an error that Allexcept needs to be within the same table, I can't use different tables in the argument&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 07:06:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3543914#M136249</guid>
      <dc:creator>maramassaf</dc:creator>
      <dc:date>2023-11-21T07:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count total number with out the join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3544010#M136255</link>
      <description>&lt;P&gt;I apologize for the confusion. You're right; ALLEXCEPT works within the same table. If you have separate tables for School, Teacher, and Observation, you might need to adjust the DAX expressions accordingly.&lt;/P&gt;&lt;P&gt;Assuming you have relationships set up between the tables (e.g., a relationship between Teacher and Observation on the teacher's name, and another relationship between Observation and School on the campus), you can try the following measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Teachers = COUNTROWS(VALUES(Teacher[TeacherName]))&lt;/P&gt;&lt;P&gt;Observations Per Teacher = COUNTROWS(Observation)&lt;/P&gt;&lt;P&gt;Observations Per Teacher Per School =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Observations Per Teacher],&lt;BR /&gt;ALLEXCEPT(&lt;BR /&gt;Teacher,&lt;BR /&gt;Teacher[SchoolName]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Observations Per Teacher Per Campus =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Observations Per Teacher],&lt;BR /&gt;ALLEXCEPT(&lt;BR /&gt;Teacher,&lt;BR /&gt;Teacher[CampusName]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In these measures, I've replaced 'Observation' with 'Teacher' in the ALLEXCEPT arguments, assuming that the relationships are established between Teacher and Observation as well as Teacher and School based on SchoolName and CampusName, respectively.&lt;/P&gt;&lt;P&gt;If your relationships are different or if you encounter issues, you may need to adapt the expressions based on your specific table relationships. Please make sure that relationships between tables are properly defined in your data model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 07:47:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/3544010#M136255</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-11-21T07:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count total number with out the join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/4214580#M167066</link>
      <description>&lt;P&gt;Please accept it as a solution so that other community members could get benefit from it.&lt;/P&gt;&lt;P&gt;Very Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards:&lt;/P&gt;&lt;P&gt;Your Kudeod Ali Abbas&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 11:23:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-total-number-with-out-the-join/m-p/4214580#M167066</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-10-03T11:23:28Z</dc:date>
    </item>
  </channel>
</rss>

