<?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: Determining Headcount month by month based on hiring date, termination date, and employee ID in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determining-Headcount-month-by-month-based-on-hiring-date/m-p/1749056#M36396</link>
    <description>&lt;P&gt;You need to do the following at least:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make one of those relationships between the date table and employee_key table active. It cannot be more than one, and rarely should be less than one. That isn't never, but it is in this case. I assumed below it is the Hiring Date field.&lt;/LI&gt;
&lt;LI&gt;Drop the Month&amp;amp;YEar field from your Date table into the pivot table as a row.&lt;/LI&gt;
&lt;LI&gt;Use this measure - &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Hiring Date = COUNTROWS(EMPLOYEE_KEY)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;Use the below measure for the Term date count&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="markup"&gt;Termination Date =
CALCULATE(
    COUNTROWS( EMPLOYEE_KEY ),
    USERELATIONSHIP ( EMPLOYEE_KEY[Termination Date], Date[Date] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that isn't what you need&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;please post sample non-confidential data&amp;nbsp; for us to use per these links.&lt;/P&gt;
&lt;P&gt;How to get good help fast. Help us help you.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="https://www.sqlbi.com/blog/alberto/2021/01/22/on-how-to-ask-a-technical-question-if-you-really-want-an-answer/" rel="noopener" target="_blank"&gt;How To Ask A Technical Question If you Really Want An Answer&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" rel="noopener" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt; - Give us a good and concise explanation&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" rel="noopener" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt; - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Mar 2021 22:37:31 GMT</pubDate>
    <dc:creator>edhans</dc:creator>
    <dc:date>2021-03-26T22:37:31Z</dc:date>
    <item>
      <title>Determining Headcount month by month based on hiring date, termination date, and employee ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determining-Headcount-month-by-month-based-on-hiring-date/m-p/1749018#M36395</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In dire need of help here. I have a HR dataset that contains Employee ID, Hiring Date, and Termination date. I am being asked to calculate total headcount from November 2020 until April 2021.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The image shown below is the datamodel that I have created within PowerPivot/Power Query/InExcel. Please do not pay attention to the All_Data. This is irrelevant. The main focus is the Employee_Key with all relevant informaiton, and the dynamic Date table created. How can I go about creating a pivot table that shows month to month, the total headcount based on the hiring and term?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any help and insight I could get here.&lt;BR /&gt;&lt;BR /&gt;Thank 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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 21:30:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determining-Headcount-month-by-month-based-on-hiring-date/m-p/1749018#M36395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-26T21:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Headcount month by month based on hiring date, termination date, and employee ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determining-Headcount-month-by-month-based-on-hiring-date/m-p/1749056#M36396</link>
      <description>&lt;P&gt;You need to do the following at least:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make one of those relationships between the date table and employee_key table active. It cannot be more than one, and rarely should be less than one. That isn't never, but it is in this case. I assumed below it is the Hiring Date field.&lt;/LI&gt;
&lt;LI&gt;Drop the Month&amp;amp;YEar field from your Date table into the pivot table as a row.&lt;/LI&gt;
&lt;LI&gt;Use this measure - &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Hiring Date = COUNTROWS(EMPLOYEE_KEY)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;Use the below measure for the Term date count&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="markup"&gt;Termination Date =
CALCULATE(
    COUNTROWS( EMPLOYEE_KEY ),
    USERELATIONSHIP ( EMPLOYEE_KEY[Termination Date], Date[Date] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that isn't what you need&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;please post sample non-confidential data&amp;nbsp; for us to use per these links.&lt;/P&gt;
&lt;P&gt;How to get good help fast. Help us help you.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="https://www.sqlbi.com/blog/alberto/2021/01/22/on-how-to-ask-a-technical-question-if-you-really-want-an-answer/" rel="noopener" target="_blank"&gt;How To Ask A Technical Question If you Really Want An Answer&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" rel="noopener" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt; - Give us a good and concise explanation&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" rel="noopener" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt; - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 22:37:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determining-Headcount-month-by-month-based-on-hiring-date/m-p/1749056#M36396</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-03-26T22:37:31Z</dc:date>
    </item>
  </channel>
</rss>

