<?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: Dynamic Summarized table - selected count in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Summarized-table-selected-count/m-p/2764227#M85804</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="411064" data-lia-user-login="PGY" class="lia-mention lia-mention-user"&gt;PGY&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please follow the method described in the attached file. THe solution is based on the assumption that Priority column is of integer data type and contains consecutive values like { 1, 2, 3, ..... }&lt;/P&gt;
&lt;P&gt;You will need to have a separate&amp;nbsp;and disconnected table for slicing that contains the priority&amp;nbsp;name and number.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Distinct Count = 
SUMX ( 
    VALUES ( Priority[Priority] ),
    VAR CurrentPriority = Priority[Priority]
    VAR PreviousPriorities = FILTER ( ALL ( Priority[Priority] ), Priority[Priority] &amp;lt; CurrentPriority )
    VAR CurrentMembers = CALCULATETABLE ( VALUES ( Input[Member] ), Input[Priority] = CurrentPriority )
    VAR PreviousMembers = CALCULATETABLE ( VALUES ( Input[Member] ), Input[Priority] IN PreviousPriorities )
    RETURN
        COUNTROWS ( EXCEPT ( CurrentMembers, PreviousMembers ) ) + 0
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;% Local = 
VAR Numerator = CALCULATE ( [Distinct Count], Input[Origion] = "Local" )
VAR Denomimator = [Distinct Count]
RETURN
    DIVIDE ( Numerator, Denomimator ) + 0&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;*UPDATE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The solution is updated fixing the Total&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 11:48:25 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-09-13T11:48:25Z</dc:date>
    <item>
      <title>Dynamic Summarized table - selected count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Summarized-table-selected-count/m-p/2764050#M85785</link>
      <description>&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need help to create a dynamic summarized table that achieve the following outcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The input table contains team member and priority for the role (where 1 is the highest). One member can be considered for several roles with different priority. Would like to calculate distinct count of member only at their most priority level. The summary table should be dynamically adjusted the calculation based on the user selections on filters (Organization, Team and Role).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input Table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Expected outcome:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 1) if user doesn't select any filter (means all population)&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Priority 1 has 2 counts for C1 and C2&lt;/P&gt;&lt;P&gt;Priority 2 has 1 count for C3&amp;nbsp; (C2 is already counted in priority 1 therefore not included here)&lt;/P&gt;&lt;P&gt;Priority 3 has 1 count for C4 (C1 and C3 are already counted in higher priority, therefore not included here)&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;Case 2) User select filter Organization = O1&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Priority 1 has 2 counts for C1 and C2&lt;/P&gt;&lt;P&gt;Priority 2 has 1 count for C3 (C2 is already counted for priority 1 therefore not included here)&lt;/P&gt;&lt;P&gt;Priority 3 has 0 count as C1 is already counted for priority 1 therefore not included here&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried summarized table however it is static - not adjusting to the user filters. Kindly advice on how to achieve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Peggy&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 10:15:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Summarized-table-selected-count/m-p/2764050#M85785</guid>
      <dc:creator>PGY</dc:creator>
      <dc:date>2022-09-13T10:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Summarized table - selected count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Summarized-table-selected-count/m-p/2764227#M85804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="411064" data-lia-user-login="PGY" class="lia-mention lia-mention-user"&gt;PGY&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please follow the method described in the attached file. THe solution is based on the assumption that Priority column is of integer data type and contains consecutive values like { 1, 2, 3, ..... }&lt;/P&gt;
&lt;P&gt;You will need to have a separate&amp;nbsp;and disconnected table for slicing that contains the priority&amp;nbsp;name and number.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Distinct Count = 
SUMX ( 
    VALUES ( Priority[Priority] ),
    VAR CurrentPriority = Priority[Priority]
    VAR PreviousPriorities = FILTER ( ALL ( Priority[Priority] ), Priority[Priority] &amp;lt; CurrentPriority )
    VAR CurrentMembers = CALCULATETABLE ( VALUES ( Input[Member] ), Input[Priority] = CurrentPriority )
    VAR PreviousMembers = CALCULATETABLE ( VALUES ( Input[Member] ), Input[Priority] IN PreviousPriorities )
    RETURN
        COUNTROWS ( EXCEPT ( CurrentMembers, PreviousMembers ) ) + 0
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;% Local = 
VAR Numerator = CALCULATE ( [Distinct Count], Input[Origion] = "Local" )
VAR Denomimator = [Distinct Count]
RETURN
    DIVIDE ( Numerator, Denomimator ) + 0&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;*UPDATE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The solution is updated fixing the Total&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 11:48:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Summarized-table-selected-count/m-p/2764227#M85804</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-13T11:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Summarized table - selected count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Summarized-table-selected-count/m-p/2766801#M85961</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, Awesome - thank you so much for the solution!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 09:42:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Summarized-table-selected-count/m-p/2766801#M85961</guid>
      <dc:creator>PGY</dc:creator>
      <dc:date>2022-09-14T09:42:00Z</dc:date>
    </item>
  </channel>
</rss>

