<?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: Calculating Total Employees each Month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090844#M108273</link>
    <description>&lt;P&gt;You're missing the COUNTROWS from the CALCULATE statement&lt;/P&gt;</description>
    <pubDate>Tue, 21 Feb 2023 16:12:39 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-02-21T16:12:39Z</dc:date>
    <item>
      <title>Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090287#M108226</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking to create a measure which tells me which employees are present at a certain month and year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a "Persons" Table with the following fields: Full Name, First Name, Last Name, Start Date, End Date.&amp;nbsp;&lt;BR /&gt;I have a "Calendar" table with the following fields: Date, Month, Year, YearMonth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calendar is linked to Persons via an Active One to Many Relationship to Start Date. And a non-active relationship between date and End Date.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;How I can calculate how many staff at present at each month and year using this information.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As the result I'm getting at the moment are only returning data for the month where people have a start date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Example Aiden Sally's Count should appear from Jun 2018 - March 2023.&lt;/P&gt;&lt;P&gt;For Example Yuliia Susan's Count should appear from Jun 2022 - March 2023.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 12:18:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090287#M108226</guid>
      <dc:creator>VaughanM</dc:creator>
      <dc:date>2023-02-21T12:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090557#M108244</link>
      <description>&lt;P&gt;try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Active Employees =
VAR MinDate =
    MIN ( 'Date'[Date] )
VAR MaxDate =
    MAX ( 'Date'[Date] )
VAR Result =
    CALCULATE (
        COUNTROWS ( 'Staff' ),
        'Staff'[Start date] &amp;lt;= MaxDate
            &amp;amp;&amp;amp; (
                'Staff'[End date] &amp;gt;= MinDate
                    || ISBLANK ( 'Staff'[End date] )
            )
    )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Feb 2023 14:22:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090557#M108244</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-02-21T14:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090711#M108257</link>
      <description>&lt;P&gt;Hi Johnt75,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dax you provided only produces figures for when the employee starts.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For Example Aiden Sally would only appear in June 2018 and not in future months.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 15:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090711#M108257</guid>
      <dc:creator>VaughanM</dc:creator>
      <dc:date>2023-02-21T15:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090719#M108259</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Active Employees =
VAR MinDate =
    MIN ( 'Date'[Date] )
VAR MaxDate =
    MAX ( 'Date'[Date] )
VAR Result =
    CALCULATE (
        COUNTROWS ( 'Staff' ),
        REMOVEFILTERS ( 'Staff'[Start date], 'Staff'[End date] ),
        'Staff'[Start date] &amp;lt;= MaxDate
            &amp;amp;&amp;amp; (
                'Staff'[End date] &amp;gt;= MinDate
                    || ISBLANK ( 'Staff'[End date] )
            )
    )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Feb 2023 15:26:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090719#M108259</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-02-21T15:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090734#M108262</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I'm getting this error now appearing with this updated one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;"the expression refers to multiple columns. Multiple columns cannot be converted to scalar value."&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 15:32:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090734#M108262</guid>
      <dc:creator>VaughanM</dc:creator>
      <dc:date>2023-02-21T15:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090756#M108263</link>
      <description>&lt;P&gt;can you post a shot of the full measure so we can see where the red lines are and see what exactly it is complaining about&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 15:45:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090756#M108263</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-02-21T15:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090814#M108270</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please see attached full shot of the measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically would like to get the figures below. So during December 2022 I had 179 Employees with a start date equal or less than 31/12/2022, and a leaving date&amp;nbsp;equal or less than 31/12/2022 or blank. Then in Jan 2023 184. Etc etc.&amp;nbsp;&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;</description>
      <pubDate>Tue, 21 Feb 2023 16:04:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090814#M108270</guid>
      <dc:creator>VaughanM</dc:creator>
      <dc:date>2023-02-21T16:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090844#M108273</link>
      <description>&lt;P&gt;You're missing the COUNTROWS from the CALCULATE statement&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 16:12:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090844#M108273</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-02-21T16:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Total Employees each Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090850#M108275</link>
      <description>&lt;P&gt;I've just re-added it and the numbers are still the same as the first statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 16:15:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Total-Employees-each-Month/m-p/3090850#M108275</guid>
      <dc:creator>VaughanM</dc:creator>
      <dc:date>2023-02-21T16:15:49Z</dc:date>
    </item>
  </channel>
</rss>

