<?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: Average of Monthly Distinct Headcount in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-Monthly-Distinct-Headcount/m-p/127934#M237</link>
    <description>&lt;P&gt;I created some sample data to test this out. My assumption is that you could have the same employee in multiple months, so instead of doing a distinctCount, I did a Count. This way you are counting the employee more than once.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a measure to get the the employee count:&lt;/P&gt;&lt;P&gt;Employee Count:=COUNT(Sheet1[Employee Number])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then created a measure that would give me the employee count by months (this is using the previous meausre):&lt;/P&gt;&lt;P&gt;Employee Count by Month:=CALCULATE([Employee Count], all(Sheet1[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a measure to get the total count of&amp;nbsp;months (this is removing all filters on Sheet1, so be aware. But it works in this scenario):&lt;/P&gt;&lt;P&gt;Total Month Count:=CALCULATE(DISTINCTCOUNT(Sheet1[Month]),all(Sheet1))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Get the overall average:&lt;/P&gt;&lt;P&gt;Overall Average Employee Count:=DIVIDE([Employee Count by Month],[Total Month Count])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this works for you.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2017 20:01:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-02-15T20:01:21Z</dc:date>
    <item>
      <title>Average of Monthly Distinct Headcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-Monthly-Distinct-Headcount/m-p/123177#M221</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble calculating&amp;nbsp;the average monthly headcount of employees. My data has the employee number, month. I'm using the DISTINCTCOUNT formula on the employee number column to get the headcount, however i'm not able to get the monthly average. My data looks like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee Number&lt;/TD&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;457277&lt;/TD&gt;&lt;TD&gt;1/3/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;419663&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;968015&lt;/TD&gt;&lt;TD&gt;1/2/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;620572&lt;/TD&gt;&lt;TD&gt;1/2/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;522371&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;345707&lt;/TD&gt;&lt;TD&gt;1/1/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;584626&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;226319&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;751944&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;288036&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;417907&lt;/TD&gt;&lt;TD&gt;1/1/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;578683&lt;/TD&gt;&lt;TD&gt;1/1/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;240642&lt;/TD&gt;&lt;TD&gt;1/1/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;562938&lt;/TD&gt;&lt;TD&gt;1/2/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;911995&lt;/TD&gt;&lt;TD&gt;1/3/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;625027&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;522371&lt;/TD&gt;&lt;TD&gt;1/2/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;345707&lt;/TD&gt;&lt;TD&gt;1/4/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;584626&lt;/TD&gt;&lt;TD&gt;1/2/16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;226319&lt;/TD&gt;&lt;TD&gt;1/1/16&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as per this data the month-wise headcount is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Distinct Count of Employee Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mar&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Apr&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;therefore my average monthly headcount would be 5. Can someone help me with the formula that can help me create a measure which gives this result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA.&lt;/P&gt;&lt;P&gt;Alan.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 11:49:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-Monthly-Distinct-Headcount/m-p/123177#M221</guid>
      <dc:creator>alan_joseph</dc:creator>
      <dc:date>2017-02-06T11:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Average of Monthly Distinct Headcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-Monthly-Distinct-Headcount/m-p/124068#M223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="21116" data-lia-user-login="alan_joseph" class="lia-mention lia-mention-user"&gt;alan_joseph&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check this out&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Calculating-average-of-values-from-a-measure-which-have-been/td-p/27246" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Calculating-average-of-values-from-a-measure-which-have-been/td-p/27246&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it solves your issue please accept it as a solution and also give KUDOS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CheenuSing&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 03:28:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-Monthly-Distinct-Headcount/m-p/124068#M223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-08T03:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Average of Monthly Distinct Headcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-Monthly-Distinct-Headcount/m-p/127934#M237</link>
      <description>&lt;P&gt;I created some sample data to test this out. My assumption is that you could have the same employee in multiple months, so instead of doing a distinctCount, I did a Count. This way you are counting the employee more than once.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a measure to get the the employee count:&lt;/P&gt;&lt;P&gt;Employee Count:=COUNT(Sheet1[Employee Number])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then created a measure that would give me the employee count by months (this is using the previous meausre):&lt;/P&gt;&lt;P&gt;Employee Count by Month:=CALCULATE([Employee Count], all(Sheet1[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a measure to get the total count of&amp;nbsp;months (this is removing all filters on Sheet1, so be aware. But it works in this scenario):&lt;/P&gt;&lt;P&gt;Total Month Count:=CALCULATE(DISTINCTCOUNT(Sheet1[Month]),all(Sheet1))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Get the overall average:&lt;/P&gt;&lt;P&gt;Overall Average Employee Count:=DIVIDE([Employee Count by Month],[Total Month Count])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this works for you.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 20:01:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-Monthly-Distinct-Headcount/m-p/127934#M237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-15T20:01:21Z</dc:date>
    </item>
  </channel>
</rss>

