<?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: Headcount Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Headcount-Calculation/m-p/2834648#M90399</link>
    <description>&lt;P&gt;Thanks for reverting&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;.&lt;/P&gt;&lt;P&gt;Found the solution using similar logic for the YearMonth ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;F_OpeningHC =&lt;BR /&gt;var yr = SELECTEDVALUE(Dim_time[Year])&lt;BR /&gt;var ml = SELECTEDVALUE(Dim_time[MonthLoad])&lt;BR /&gt;VAR yearmonth = CALCULATE(MIN(sf_CSS[time_id]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;CALCULATE(SUM(sf_CSS[hc_opening]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml,sf_CSS[time_id]= yearmonth)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;F_ClosingHC =&lt;/P&gt;&lt;P&gt;var yr = SELECTEDVALUE(Dim_time[Year])&lt;BR /&gt;var ml = SELECTEDVALUE(Dim_time[MonthLoad])&lt;BR /&gt;VAR yearmonth = CALCULATE(MAX(sf_CSS[time_id]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml)&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;CALCULATE(SUM(sf_CSS[hc_closing]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml,sf_CSS[time_id]=yearmonth)&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 17:09:01 GMT</pubDate>
    <dc:creator>nareshr89</dc:creator>
    <dc:date>2022-10-11T17:09:01Z</dc:date>
    <item>
      <title>Headcount Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Headcount-Calculation/m-p/2833826#M90344</link>
      <description>&lt;P&gt;I need help with a scenario with the headcount, where the numbers given under Opening is picked as is at monthly level but when its quarterly level we need to maintain the Jan data as Opening and Closing headcount to be last month of the period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex - Q1 -&amp;gt; Opening will be of Jan and Closing numbers will be of Mar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the DAX used by me which sums up when selecting Q1, instead i need the above logic to work. Sample excel file attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;F_OpeningHC =&lt;/P&gt;&lt;P&gt;var yr = SELECTEDVALUE(Dim_time[Year])&lt;BR /&gt;var ml = SELECTEDVALUE(Dim_time[MonthLoad])&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;CALCULATE(SUM(sf_CSS[hc_opening]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking for the help to build this logic.&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;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 11:06:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Headcount-Calculation/m-p/2833826#M90344</guid>
      <dc:creator>nareshr89</dc:creator>
      <dc:date>2022-10-11T11:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Headcount Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Headcount-Calculation/m-p/2834613#M90395</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366921" data-lia-user-login="nareshr89" class="lia-mention lia-mention-user"&gt;nareshr89&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies for the late reply. I was out of office all day.&amp;nbsp;&lt;BR /&gt;Please try by replacing&amp;nbsp;SELECTEDVALUE ( Dim_time[MonthLoad] ) with&amp;nbsp;&lt;SPAN&gt;MIN ( Dim_time[MonthLoad] ) for Opening HC and&amp;nbsp;MAX ( Dim_time[MonthLoad] ) for Closing HC&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 16:35:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Headcount-Calculation/m-p/2834613#M90395</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-11T16:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Headcount Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Headcount-Calculation/m-p/2834648#M90399</link>
      <description>&lt;P&gt;Thanks for reverting&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;.&lt;/P&gt;&lt;P&gt;Found the solution using similar logic for the YearMonth ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;F_OpeningHC =&lt;BR /&gt;var yr = SELECTEDVALUE(Dim_time[Year])&lt;BR /&gt;var ml = SELECTEDVALUE(Dim_time[MonthLoad])&lt;BR /&gt;VAR yearmonth = CALCULATE(MIN(sf_CSS[time_id]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;CALCULATE(SUM(sf_CSS[hc_opening]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml,sf_CSS[time_id]= yearmonth)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;F_ClosingHC =&lt;/P&gt;&lt;P&gt;var yr = SELECTEDVALUE(Dim_time[Year])&lt;BR /&gt;var ml = SELECTEDVALUE(Dim_time[MonthLoad])&lt;BR /&gt;VAR yearmonth = CALCULATE(MAX(sf_CSS[time_id]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml)&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;CALCULATE(SUM(sf_CSS[hc_closing]),sf_CSS[sf_year]=yr,sf_CSS[sf_month_load]=ml,sf_CSS[time_id]=yearmonth)&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 17:09:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Headcount-Calculation/m-p/2834648#M90399</guid>
      <dc:creator>nareshr89</dc:creator>
      <dc:date>2022-10-11T17:09:01Z</dc:date>
    </item>
  </channel>
</rss>

