<?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 Rows on another table based on attributes on main table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4042962#M160348</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="402903" data-lia-user-login="aflintdepm" class="lia-mention lia-mention-user"&gt;aflintdepm&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could use below measure -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
COUNTROWS (
    FILTER (
        'Task table',
        'Task table'[EE_ID] = MAX ( EE_Status[EE_ID] )
            &amp;amp;&amp;amp; 'Task table'[Task_Status] = "Incomplete"
            &amp;amp;&amp;amp; MAX ( EE_Status[Status] ) = "Terminated"
    )
) + 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output -&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;</description>
    <pubDate>Mon, 15 Jul 2024 17:24:31 GMT</pubDate>
    <dc:creator>Samarth_18</dc:creator>
    <dc:date>2024-07-15T17:24:31Z</dc:date>
    <item>
      <title>Count Rows on another table based on attributes on main table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4042947#M160347</link>
      <description>&lt;P&gt;I have 2 tables, one is a list of employees with employment status and the other is a list of tasks assigned to those employees with the task status.&amp;nbsp; Everthing is linked by EE_ID, but I did have to create a table of just unique values to avoid Many:Many between the 2 source tables, so my relationship looks like this:&lt;BR /&gt;Task Table *-&amp;gt;1 Unique EE_ID 1&amp;lt;-* EE Status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need create a measure that tells me the list of Incomplete tasks when an Employee is Terminated so those tasks can be reassigned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to present the results in a table or matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired Ouput:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;EE_ID&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;Task Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1111&lt;/TD&gt;&lt;TD&gt;John Smith&lt;/TD&gt;&lt;TD&gt;Terminated&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2222&lt;/TD&gt;&lt;TD&gt;Bob Jones&lt;/TD&gt;&lt;TD&gt;Terminated&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EE_Status:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;EE_ID&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1111&lt;/TD&gt;&lt;TD&gt;John Smith&lt;/TD&gt;&lt;TD&gt;Terminated&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2222&lt;/TD&gt;&lt;TD&gt;Bob Jones&lt;/TD&gt;&lt;TD&gt;Terminated&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;Jane Doe&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Task table:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;EE_ID&lt;/TD&gt;&lt;TD&gt;Task_Name&lt;/TD&gt;&lt;TD&gt;Task_Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1111&lt;/TD&gt;&lt;TD&gt;Visit&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1111&lt;/TD&gt;&lt;TD&gt;Visit&lt;/TD&gt;&lt;TD&gt;Incomplete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1111&lt;/TD&gt;&lt;TD&gt;Eval&lt;/TD&gt;&lt;TD&gt;Incomplete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2222&lt;/TD&gt;&lt;TD&gt;Visit&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2222&lt;/TD&gt;&lt;TD&gt;Visit&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2222&lt;/TD&gt;&lt;TD&gt;Eval&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;Visit&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;Visit&lt;/TD&gt;&lt;TD&gt;Incomplete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3333&lt;/TD&gt;&lt;TD&gt;Eval&lt;/TD&gt;&lt;TD&gt;Incomplete&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 15 Jul 2024 17:00:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4042947#M160347</guid>
      <dc:creator>aflintdepm</dc:creator>
      <dc:date>2024-07-15T17:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count Rows on another table based on attributes on main table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4042962#M160348</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="402903" data-lia-user-login="aflintdepm" class="lia-mention lia-mention-user"&gt;aflintdepm&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could use below measure -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
COUNTROWS (
    FILTER (
        'Task table',
        'Task table'[EE_ID] = MAX ( EE_Status[EE_ID] )
            &amp;amp;&amp;amp; 'Task table'[Task_Status] = "Incomplete"
            &amp;amp;&amp;amp; MAX ( EE_Status[Status] ) = "Terminated"
    )
) + 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output -&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;</description>
      <pubDate>Mon, 15 Jul 2024 17:24:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4042962#M160348</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2024-07-15T17:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count Rows on another table based on attributes on main table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4044662#M160428</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312802" data-lia-user-login="Samarth_18" class="lia-mention lia-mention-user"&gt;Samarth_18&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thank you for the response.&amp;nbsp; Can you please clarify the function of the MAX in the measure?&amp;nbsp; Other than that, I believe I understand the syntax&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 17:15:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4044662#M160428</guid>
      <dc:creator>aflintdepm</dc:creator>
      <dc:date>2024-07-16T17:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Count Rows on another table based on attributes on main table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4051048#M160736</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="402903" data-lia-user-login="aflintdepm" class="lia-mention lia-mention-user"&gt;aflintdepm&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try the following approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IncompleteTasksForTerminated = 
VAR TerminatedEmployees = 
    FILTER (
        'EE_Status',
        'EE_Status'[Status] = "Terminated"
    )

VAR IncompleteTasks = 
    FILTER (
        'Task Table',
        'Task Table'[Task_Status] = "Incomplete"
    )

VAR Result = 
    COUNTROWS (
        FILTER (
            'Task Table',
            'Task Table'[EE_ID] IN VALUES (TerminatedEmployees[EE_ID]) &amp;amp;&amp;amp;
            'Task Table'[Task_Status] = "Incomplete"
        )
    )

RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 15:40:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4051048#M160736</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2024-07-19T15:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count Rows on another table based on attributes on main table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4051617#M160760</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="402903" data-lia-user-login="aflintdepm" class="lia-mention lia-mention-user"&gt;aflintdepm&lt;/a&gt;&amp;nbsp;, It's just to pick a value of&amp;nbsp;EE_ID,&amp;nbsp;Status from the current context.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 04:21:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-Rows-on-another-table-based-on-attributes-on-main-table/m-p/4051617#M160760</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2024-07-20T04:21:53Z</dc:date>
    </item>
  </channel>
</rss>

