<?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 Help to calculate the Count of a measure result in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-to-calculate-the-Count-of-a-measure-result/m-p/2419572#M64037</link>
    <description>&lt;P&gt;I have a table capturing all interactions an operator has every day, we use it to calculate performance and recently they added a couple of columns that help me identify if the customer has contacted us, I use a filter to get the % of interactions where the customer had a follow-up interaction meeting certain conditions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Follow Up = DIVIDE( CALCULATE( SUM(Conversations), Condition 1 = "Yes" &amp;amp;&amp;amp; Condition 2 = "Yes") , SUM(Conversations))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives me the percentage of Conversations meeting certain conditions, and I use it to calculate the Agent and Supervisor Performance in a table somehow like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Agent&lt;/TD&gt;&lt;TD&gt;Supervisor&lt;/TD&gt;&lt;TD&gt;Interactions&lt;/TD&gt;&lt;TD&gt;Follow Up&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 1&lt;/TD&gt;&lt;TD&gt;Supervisor 1&lt;/TD&gt;&lt;TD&gt;862&lt;/TD&gt;&lt;TD&gt;12.99%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 2&lt;/TD&gt;&lt;TD&gt;Supervisor 1&lt;/TD&gt;&lt;TD&gt;841&lt;/TD&gt;&lt;TD&gt;9.51%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 3&lt;/TD&gt;&lt;TD&gt;Supervisor 1&lt;/TD&gt;&lt;TD&gt;830&lt;/TD&gt;&lt;TD&gt;15.90%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 4&lt;/TD&gt;&lt;TD&gt;Supervisor 2&lt;/TD&gt;&lt;TD&gt;793&lt;/TD&gt;&lt;TD&gt;22.95%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 5&lt;/TD&gt;&lt;TD&gt;Supervisor 2&lt;/TD&gt;&lt;TD&gt;781&lt;/TD&gt;&lt;TD&gt;15.75%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 6&lt;/TD&gt;&lt;TD&gt;Supervisor 2&lt;/TD&gt;&lt;TD&gt;774&lt;/TD&gt;&lt;TD&gt;17.18%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 7&lt;/TD&gt;&lt;TD&gt;Supervisor 3&lt;/TD&gt;&lt;TD&gt;768&lt;/TD&gt;&lt;TD&gt;17.84%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 8&lt;/TD&gt;&lt;TD&gt;Supervisor 3&lt;/TD&gt;&lt;TD&gt;755&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;22.25%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Agent 9&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Supervisor 3&lt;/TD&gt;&lt;TD&gt;741&lt;/TD&gt;&lt;TD&gt;22.81%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are around 3k agents, I was asked to get the count of agents in different follow-up buckets, the result they are looking for is something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Bucket&lt;/TD&gt;&lt;TD&gt;Agent Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0.00%-10.00%&lt;/TD&gt;&lt;TD&gt;1356&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10.01% - 20.00%&lt;/TD&gt;&lt;TD&gt;1254&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20.01% - 30.00%&lt;/TD&gt;&lt;TD&gt;534&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30.01% - 40.00%&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;40%+&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to get a distinct count of the agent name using the Follow Up measure as Filter but is not working, is it possible and if it is, any ideas?&lt;BR /&gt;Here is a sample of the data in OneDrive:&amp;nbsp;&lt;A title="PBIX Sample" href="https://1drv.ms/u/s!AnZwrT5mFYRmaae-xsbSzx1I5qg?e=BtbZjQ" target="_blank" rel="noopener"&gt;OneDrive Link with Sample&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 27 Mar 2022 04:39:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-03-27T04:39:10Z</dc:date>
    <item>
      <title>Help to calculate the Count of a measure result</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-to-calculate-the-Count-of-a-measure-result/m-p/2419572#M64037</link>
      <description>&lt;P&gt;I have a table capturing all interactions an operator has every day, we use it to calculate performance and recently they added a couple of columns that help me identify if the customer has contacted us, I use a filter to get the % of interactions where the customer had a follow-up interaction meeting certain conditions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Follow Up = DIVIDE( CALCULATE( SUM(Conversations), Condition 1 = "Yes" &amp;amp;&amp;amp; Condition 2 = "Yes") , SUM(Conversations))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives me the percentage of Conversations meeting certain conditions, and I use it to calculate the Agent and Supervisor Performance in a table somehow like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Agent&lt;/TD&gt;&lt;TD&gt;Supervisor&lt;/TD&gt;&lt;TD&gt;Interactions&lt;/TD&gt;&lt;TD&gt;Follow Up&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 1&lt;/TD&gt;&lt;TD&gt;Supervisor 1&lt;/TD&gt;&lt;TD&gt;862&lt;/TD&gt;&lt;TD&gt;12.99%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 2&lt;/TD&gt;&lt;TD&gt;Supervisor 1&lt;/TD&gt;&lt;TD&gt;841&lt;/TD&gt;&lt;TD&gt;9.51%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 3&lt;/TD&gt;&lt;TD&gt;Supervisor 1&lt;/TD&gt;&lt;TD&gt;830&lt;/TD&gt;&lt;TD&gt;15.90%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 4&lt;/TD&gt;&lt;TD&gt;Supervisor 2&lt;/TD&gt;&lt;TD&gt;793&lt;/TD&gt;&lt;TD&gt;22.95%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 5&lt;/TD&gt;&lt;TD&gt;Supervisor 2&lt;/TD&gt;&lt;TD&gt;781&lt;/TD&gt;&lt;TD&gt;15.75%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 6&lt;/TD&gt;&lt;TD&gt;Supervisor 2&lt;/TD&gt;&lt;TD&gt;774&lt;/TD&gt;&lt;TD&gt;17.18%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 7&lt;/TD&gt;&lt;TD&gt;Supervisor 3&lt;/TD&gt;&lt;TD&gt;768&lt;/TD&gt;&lt;TD&gt;17.84%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Agent 8&lt;/TD&gt;&lt;TD&gt;Supervisor 3&lt;/TD&gt;&lt;TD&gt;755&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;22.25%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Agent 9&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Supervisor 3&lt;/TD&gt;&lt;TD&gt;741&lt;/TD&gt;&lt;TD&gt;22.81%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are around 3k agents, I was asked to get the count of agents in different follow-up buckets, the result they are looking for is something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Bucket&lt;/TD&gt;&lt;TD&gt;Agent Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0.00%-10.00%&lt;/TD&gt;&lt;TD&gt;1356&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10.01% - 20.00%&lt;/TD&gt;&lt;TD&gt;1254&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20.01% - 30.00%&lt;/TD&gt;&lt;TD&gt;534&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30.01% - 40.00%&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;40%+&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to get a distinct count of the agent name using the Follow Up measure as Filter but is not working, is it possible and if it is, any ideas?&lt;BR /&gt;Here is a sample of the data in OneDrive:&amp;nbsp;&lt;A title="PBIX Sample" href="https://1drv.ms/u/s!AnZwrT5mFYRmaae-xsbSzx1I5qg?e=BtbZjQ" target="_blank" rel="noopener"&gt;OneDrive Link with Sample&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2022 04:39:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-to-calculate-the-Count-of-a-measure-result/m-p/2419572#M64037</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-27T04:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help to calculate the Count of a measure result</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-to-calculate-the-Count-of-a-measure-result/m-p/2420991#M64133</link>
      <description>&lt;LI-CODE lang="markup"&gt;20.00% - 30.00% = 
var summaryTable = ADDCOLUMNS( VALUES('Data Sample'[Agent Name]), "@pct", [FollowUp%])
return COUNTROWS( FILTER( summaryTable, [@pct] &amp;gt; 0.2 &amp;amp;&amp;amp; [@pct] &amp;lt;= 0.3))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Mar 2022 09:12:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-to-calculate-the-Count-of-a-measure-result/m-p/2420991#M64133</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-03-28T09:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help to calculate the Count of a measure result</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-to-calculate-the-Count-of-a-measure-result/m-p/2428554#M64589</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my solution.&lt;/P&gt;
&lt;P&gt;1.Create a table by entering data.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2.Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Agent Count = 
VAR _table =
    ADDCOLUMNS ( VALUES ( 'Data Sample'[Agent Name] ), "Followup", [FollowUp%] )
RETURN
    SWITCH (
        MAX ( 'Table'[Bucket] ),
        "0.00%-10.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] &amp;gt; 0 &amp;amp;&amp;amp; [FollowUp%] &amp;lt;= 0.1 ) ),
        "10.01% - 20.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] &amp;gt; 0.1 &amp;amp;&amp;amp; [FollowUp%] &amp;lt;= 0.2 ) ),
        "20.01% - 30.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] &amp;gt; 0.2 &amp;amp;&amp;amp; [FollowUp%] &amp;lt;= 0.3 ) ),
        "30.01% - 40.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] &amp;gt; 0.3 &amp;amp;&amp;amp; [FollowUp%] &amp;lt;= 0.4 ) ),
        "40%+", COUNTROWS ( FILTER ( _table, [FollowUp%] &amp;gt;= 0.4 ) )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&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;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Stephen Tao&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;STRONG&gt;&lt;EM&gt; Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 05:47:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-to-calculate-the-Count-of-a-measure-result/m-p/2428554#M64589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-31T05:47:57Z</dc:date>
    </item>
  </channel>
</rss>

