<?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 Count of employees present in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3187268#M115449</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a table with a list of 1500 employees and their arrival date in the company and the depature date if they heave leave the company. I need to present a chart with the number of empoyees present for each month, considering that an employee is present for the month if he has arrived or has left the company during the month.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Could you help me ?&lt;/P&gt;&lt;P&gt;Thanks you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 21:38:00 GMT</pubDate>
    <dc:creator>Teddy92</dc:creator>
    <dc:date>2023-04-13T21:38:00Z</dc:date>
    <item>
      <title>Count of employees present</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3187268#M115449</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a table with a list of 1500 employees and their arrival date in the company and the depature date if they heave leave the company. I need to present a chart with the number of empoyees present for each month, considering that an employee is present for the month if he has arrived or has left the company during the month.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Could you help me ?&lt;/P&gt;&lt;P&gt;Thanks you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 21:38:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3187268#M115449</guid>
      <dc:creator>Teddy92</dc:creator>
      <dc:date>2023-04-13T21:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count of employees present</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3187278#M115452</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="545767" data-lia-user-login="Teddy92" class="lia-mention lia-mention-user"&gt;Teddy92&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;You may creat a unrelated date table then plot a chart with&amp;nbsp;the dates[date] and a measure like:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR _month=FORMAT(MAX(dates[date]), "yymm")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TableName,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FORMAT(TableName[ArrivalDate], "yymm")&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;_month&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp;(FORMAT(TableName[DepartureDate], "yymm")&amp;gt;=_month || TableName[DepartureDate]=BLANK())&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Apr 2023 21:53:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3187278#M115452</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-04-13T21:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count of employees present</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3188943#M115593</link>
      <description>&lt;P&gt;Thanks&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I have adapted your code to my context, but I have this error for the measure : "&lt;SPAN&gt;the syntax for RETURN is incorrect".&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 16:03:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3188943#M115593</guid>
      <dc:creator>Teddy92</dc:creator>
      <dc:date>2023-04-14T16:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Count of employees present</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3189542#M115626</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="545767" data-lia-user-login="Teddy92" class="lia-mention lia-mention-user"&gt;Teddy92&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) try to create a calcualed table like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dates = 
ADDCOLUMNS(
    CALENDAR(
        MIN(TableName[Arrival date]),
        MAX(MAX(TableName[Arrival date]), MAX(TableName[Departure date]))
    ),
    "YY/MM",
    FORMAT([Date],"YY/MM")
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) plot a visual with the [YY/MM] column and a measure like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _month=FORMAT(MAX(dates[date]), "yymm")
RETURN
COUNTROWS(
    FILTER(
        TableName,
        FORMAT(TableName[Arrival Date], "yymm")&amp;lt;=_month
        &amp;amp;&amp;amp;(FORMAT(TableName[Departure Date], "yymm")&amp;gt;=_month || TableName[Departure Date]=BLANK())
    )
)&lt;/LI-CODE&gt;&lt;P&gt;it worked like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Note: The two tables shall be unrelated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2023 12:09:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3189542#M115626</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-04-15T12:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count of employees present</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3202254#M116449</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for this solution. I have understood my mistake.&lt;/P&gt;&lt;P&gt;I am a beginner in powerBi and DAX.&lt;/P&gt;&lt;P&gt;I have just a last problem : the YY/MM are ordered by the number of employees and not by the real time. Where can I change the parameter ?&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 07:21:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-employees-present/m-p/3202254#M116449</guid>
      <dc:creator>Teddy92</dc:creator>
      <dc:date>2023-04-24T07:21:34Z</dc:date>
    </item>
  </channel>
</rss>

