<?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: Counting employees on vecation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2600370#M75138</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think you misunderstand my challenge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already have a ScheduleNr.&lt;BR /&gt;I am not interested in counting the number og vacation periods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am interested in counting the number of employees that is vacating in week 28, for instance.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2022 10:57:08 GMT</pubDate>
    <dc:creator>nikostou</dc:creator>
    <dc:date>2022-06-24T10:57:08Z</dc:date>
    <item>
      <title>Counting employees on vecation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2599757#M75114</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with employee names and vacation periods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One name can be mentioned several times in the name column, as the employee can have several vacation periods. It is possible for me to add a uniqe "ScheduleNr" if I need a uniqe identifier for the vacation period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my table I have a begin date and an end date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like some kind of solution where I can count how many employees will be vacating in one specific week.&lt;/P&gt;&lt;P&gt;It doesent matter if the employee has one, three og seven vacation days in that week. I just want to know how many employees will be on vacation for any part of that week..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Will be looking forward to hearing from you! Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 07:35:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2599757#M75114</guid>
      <dc:creator>nikostou</dc:creator>
      <dc:date>2022-06-24T07:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Counting employees on vecation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2600040#M75120</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="155557" data-lia-user-login="nikostou" class="lia-mention lia-mention-user"&gt;nikostou&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can create a new calculated column&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;ScheduleNr =
VAR CurrentName = TableName[Name]
VAR CurrentEmpTable =
    CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Name] ) )
VAR Ranking =
    RANKX ( CurrentEmpTable, TableName[BiginDate],, ASC )
RETURN
    CurrentName &amp;amp; "-" &amp;amp; Ranking&lt;/LI-CODE&gt;&lt;P&gt;Then in a measure you can return the count&lt;/P&gt;&lt;P&gt;Count = COUNT ( TableName[&lt;SPAN&gt;ScheduleNr] )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 09:13:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2600040#M75120</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-24T09:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Counting employees on vecation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2600370#M75138</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think you misunderstand my challenge.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already have a ScheduleNr.&lt;BR /&gt;I am not interested in counting the number og vacation periods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am interested in counting the number of employees that is vacating in week 28, for instance.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 10:57:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2600370#M75138</guid>
      <dc:creator>nikostou</dc:creator>
      <dc:date>2022-06-24T10:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Counting employees on vecation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2608483#M75571</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="155557" data-lia-user-login="nikostou" class="lia-mention lia-mention-user"&gt;nikostou&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A calendar table is a must, which is used for user to select the week. Then create a measure named "count" to count the number of employee.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Name] ),
    FILTER (
        'Table',
        OR (
            [BeginDate] &amp;gt;= MIN ( 'Calendar'[Date] )
                &amp;amp;&amp;amp; [BeginDate] &amp;lt;= MAX ( 'Calendar'[Date] ),
            [EndDate] &amp;gt;= MIN ( 'Calendar'[Date] )
                &amp;amp;&amp;amp; [EndDate] &amp;lt;= MAX ( 'Calendar'[Date] )
        )
    )
)
&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;Pbix in the end you can refer.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 06:45:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-employees-on-vecation/m-p/2608483#M75571</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-06-29T06:45:16Z</dc:date>
    </item>
  </channel>
</rss>

