<?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: How to calculate average length of employement, per year? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2676384#M79991</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following measure will give you the count of employees per year.&lt;/P&gt;&lt;P&gt;I have not yet done the other calculations:&lt;/P&gt;&lt;P&gt;- SUM of total employed months per year&amp;nbsp;&lt;/P&gt;&lt;P&gt;- AVG employed months per year.&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if I'm on the right path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2022 18:34:27 GMT</pubDate>
    <dc:creator>WinterMist</dc:creator>
    <dc:date>2022-08-02T18:34:27Z</dc:date>
    <item>
      <title>How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2673850#M79830</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm trying to show in a dashboard the average employee length per year. At first, I had simply worked out the difference between everyone's start and end date and displayed this as an average, but I realised that this wasn't accounting for the number of employees in any given year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g if a company only had 1 person working for them and they joined in 1990 and left in 1995, although they stayed for 5 years, in any given year between 1990 - 1995, their average length of stay would only be 1 year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data is pretty simple and has the following fields:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Employee ID&lt;/TD&gt;&lt;TD&gt;Start date&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; End date&lt;/TD&gt;&lt;TD&gt;Length of stay (months)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01/10/2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;01/12/2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;12/02/2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 06/04/2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;15/05/2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 20/05/2012&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 24&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;06/08/2008&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 07/10/2010&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 26&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to calculate this? I'm a bit lost with it right now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 07:42:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2673850#M79830</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-02T07:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2673969#M79833</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me understand a bit more?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Row 1 is from 1-OCT-20 to 1-DEC-20.&amp;nbsp; This should be 2 months, yet Length of Stay shows 12.&amp;nbsp; Am I missing something?&lt;/P&gt;&lt;P&gt;2) Row 2 "Length of Stay" shows as 2.&amp;nbsp; Is this correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;- 12-Feb-20 to 6-APR-20 should be&amp;nbsp;&lt;EM&gt;less than&amp;nbsp;&lt;/EM&gt;2 months.&amp;nbsp; (i.e. it should be "1".&amp;nbsp; Or is this not correct?&lt;/P&gt;&lt;P&gt;3) Row 3 "End Date" is 20-May-&lt;STRONG&gt;2012&lt;/STRONG&gt;.&amp;nbsp; Is this a typo?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;- If not, the end date is roughly 9 years before the start date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;- What should the end year, and length of stay be for this row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 22:06:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2673969#M79833</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-08-01T22:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2674773#M79871</link>
      <description>&lt;P&gt;Hi Nathan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your reply. Sorry, when I was trying to put in some example data, the format just kept jumping around. This is only an example I quickly tried to put together based on my actual data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 07:43:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2674773#M79871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-02T07:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2675707#M79942</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No worries at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I still don't understand is if a partial month counts as a full month or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;1) If employment only lasts 1 week in a given month (e.g. May 5-12):&lt;/P&gt;&lt;P&gt;- Does this count as 1 month of employment towards the average?&amp;nbsp; Or does it count as 0?&lt;/P&gt;&lt;P&gt;- Does this specific employee get counted as an employee for that specific year?&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) If employment starts at the end of the year (e.g. 29-DEC-2020):&lt;/P&gt;&lt;P&gt;- Does the full month of DEC 2020 count as 1 employed month?&lt;/P&gt;&lt;P&gt;- Does this specific employee get counted as an employee in the year 2020?&lt;/P&gt;&lt;P&gt;3) If employment ends at the beginning of any month (e.g. 2-SEP), should that month (e.g. September) be counted as a month of employment towards the average?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 13:33:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2675707#M79942</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-08-02T13:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2676014#M79969</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If partial months count as full months, &lt;EM&gt;and&lt;/EM&gt; those employees count toward the number of employees in the given year, then I'm understanding the calculation to be as follows.&amp;nbsp; Does this look right to you?&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;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:21:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2676014#M79969</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-08-02T15:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2676384#M79991</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following measure will give you the count of employees per year.&lt;/P&gt;&lt;P&gt;I have not yet done the other calculations:&lt;/P&gt;&lt;P&gt;- SUM of total employed months per year&amp;nbsp;&lt;/P&gt;&lt;P&gt;- AVG employed months per year.&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if I'm on the right path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 18:34:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2676384#M79991</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-08-02T18:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2678275#M80092</link>
      <description>&lt;P&gt;Hi Nathan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your time and help with this.&amp;nbsp;&lt;BR /&gt;The questions you ask have helped me to understand what I'm trying to get from the data. But using the measure you provided and adapting that to my data did just the trick of what I was trying to get to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much !!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 10:26:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2678275#M80092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-03T10:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average length of employement, per year?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2678911#M80138</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So glad the questions &amp;amp; measure were helpful to you!&lt;/P&gt;&lt;P&gt;I'm a bit relieved actually, because I have been stuck on the next step.&lt;/P&gt;&lt;P&gt;I can calculate the SUM of total months employed for each row.&lt;/P&gt;&lt;P&gt;However, this needs to be &lt;U&gt;&lt;STRONG&gt;separated by year&lt;/STRONG&gt;&lt;/U&gt; to be able to calculate the yearly average; which I cannot figure out.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;[1] Total Num Employees&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;&lt;EM&gt;for each year&lt;/EM&gt;&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;--I HAVE THIS&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;[2] Total Num Employed Months &lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;for each year&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&amp;nbsp; --I CANNOT GET THIS&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;[3] Avg Months Employeed &lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;for each year&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt; = [2] / [1]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, the following measure gives me the correct number of total months employed for each line.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;But I can't separate it by year&lt;/EM&gt; (like the manual Excel columns: 2020, 2021, 2022).&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you educate me on how you did this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 14:29:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average-length-of-employement-per-year/m-p/2678911#M80138</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2022-08-03T14:29:37Z</dc:date>
    </item>
  </channel>
</rss>

