<?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 How to show amounts for period that has been filtered out in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-amounts-for-period-that-has-been-filtered-out/m-p/2790584#M87600</link>
    <description>&lt;P&gt;Hello developers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm in need of some DAX assistance.&lt;/P&gt;&lt;P&gt;I'm trying to create a dashboard that reflects Head Count. It's almost complete, but I need to reflect a &lt;STRONG&gt;starting&lt;/STRONG&gt; head count for periods selected in my slicer. Or more logicaly explained, Head Count for the period prior to the one selected.&lt;/P&gt;&lt;P&gt;Head Count and Fiscal Period are in my Fact Table whilst Job Title is in my Dim table. The relationship between the two tables is linked by employee key and looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My fiscal periods are expressed with Fiscal Year first then the Fiscal Period. ex. 202301 = First Period in Fiscal Year 2023.&lt;/P&gt;&lt;P&gt;So far, the below DAX has been working out for me:&lt;/P&gt;&lt;P&gt;Starting HC =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(FactEmployeeFiscal[Active]),&lt;BR /&gt;FILTER(ALL(FactEmployeeFiscal[FiscalPeriod]),FactEmployeeFiscal[FiscalPeriod]),&lt;BR /&gt;FactEmployeeFiscal[RowNum]=MAX(FactEmployeeFiscal[RowNum])+1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RowNum or Row Number is an index for the Fiscal Period with the Max period = 1. Currently the highest Fiscal Period available is 202305.&lt;/P&gt;&lt;P&gt;202305 = 1; 202304 = 2; 202303 = 3 etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The trouble starts when I filter to only FY2023 and select the &lt;STRONG&gt;first&lt;/STRONG&gt; Fiscal Period. My results go blank.&lt;/P&gt;&lt;P&gt;Starting Head Count needs to be the headcount for the period prior to the one being selected. In this case when I select 202301, my measure looks for the headcout to 202212. But FY22 is filtered out, so the column goes blank.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I've switched up my formula to update the ALL comand to this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Starting HC = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[Active]&lt;/SPAN&gt;&lt;SPAN&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;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;ALL(FactEmployeeFiscal&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[FiscalPeriod]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[RowNum]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[RowNum]&lt;/SPAN&gt;&lt;SPAN&gt;)+&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The total amount is right and it's a step in the right direction, but I'm getting the same amount for every row.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;Do any of you geniouses out there know what I need to do to my DAX measure to accurately reflect HC for the first Fiscal Period in FY2023?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any Help!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 21:28:11 GMT</pubDate>
    <dc:creator>tmendoza</dc:creator>
    <dc:date>2022-09-23T21:28:11Z</dc:date>
    <item>
      <title>How to show amounts for period that has been filtered out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-amounts-for-period-that-has-been-filtered-out/m-p/2790584#M87600</link>
      <description>&lt;P&gt;Hello developers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm in need of some DAX assistance.&lt;/P&gt;&lt;P&gt;I'm trying to create a dashboard that reflects Head Count. It's almost complete, but I need to reflect a &lt;STRONG&gt;starting&lt;/STRONG&gt; head count for periods selected in my slicer. Or more logicaly explained, Head Count for the period prior to the one selected.&lt;/P&gt;&lt;P&gt;Head Count and Fiscal Period are in my Fact Table whilst Job Title is in my Dim table. The relationship between the two tables is linked by employee key and looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My fiscal periods are expressed with Fiscal Year first then the Fiscal Period. ex. 202301 = First Period in Fiscal Year 2023.&lt;/P&gt;&lt;P&gt;So far, the below DAX has been working out for me:&lt;/P&gt;&lt;P&gt;Starting HC =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(FactEmployeeFiscal[Active]),&lt;BR /&gt;FILTER(ALL(FactEmployeeFiscal[FiscalPeriod]),FactEmployeeFiscal[FiscalPeriod]),&lt;BR /&gt;FactEmployeeFiscal[RowNum]=MAX(FactEmployeeFiscal[RowNum])+1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RowNum or Row Number is an index for the Fiscal Period with the Max period = 1. Currently the highest Fiscal Period available is 202305.&lt;/P&gt;&lt;P&gt;202305 = 1; 202304 = 2; 202303 = 3 etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The trouble starts when I filter to only FY2023 and select the &lt;STRONG&gt;first&lt;/STRONG&gt; Fiscal Period. My results go blank.&lt;/P&gt;&lt;P&gt;Starting Head Count needs to be the headcount for the period prior to the one being selected. In this case when I select 202301, my measure looks for the headcout to 202212. But FY22 is filtered out, so the column goes blank.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I've switched up my formula to update the ALL comand to this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Starting HC = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[Active]&lt;/SPAN&gt;&lt;SPAN&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;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;ALL(FactEmployeeFiscal&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[FiscalPeriod]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[RowNum]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[RowNum]&lt;/SPAN&gt;&lt;SPAN&gt;)+&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The total amount is right and it's a step in the right direction, but I'm getting the same amount for every row.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;Do any of you geniouses out there know what I need to do to my DAX measure to accurately reflect HC for the first Fiscal Period in FY2023?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any Help!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 21:28:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-amounts-for-period-that-has-been-filtered-out/m-p/2790584#M87600</guid>
      <dc:creator>tmendoza</dc:creator>
      <dc:date>2022-09-23T21:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to show amounts for period that has been filtered out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-amounts-for-period-that-has-been-filtered-out/m-p/2790733#M87603</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="151494" data-lia-user-login="tmendoza" class="lia-mention lia-mention-user"&gt;tmendoza&lt;/a&gt; , You need to have a separate fiscal period table . You need the sortable continuous column for period&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Period Rank = RANKX(all(Period),Period[year period],,ASC,Dense)// Use FY Period RANK &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;Starting HC Last Period = &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[Active]&lt;/SPAN&gt;&lt;SPAN&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;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;ALL(dimFiscal&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;),&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;dimFiscal&lt;/STRONG&gt;[Period Rank]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FactEmployeeFiscal&lt;/SPAN&gt;&lt;SPAN&gt;[Period Rank]&lt;/SPAN&gt;&lt;SPAN&gt;)- &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer&lt;/P&gt;
&lt;P&gt;Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period, &lt;BR /&gt;Custom Period till date: &lt;A href="https://youtu.be/aU2aKbnHuWs&amp;amp;t=145s" target="_blank"&gt;https://youtu.be/aU2aKbnHuWs&amp;amp;t=145s&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2022 02:08:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-amounts-for-period-that-has-been-filtered-out/m-p/2790733#M87603</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-24T02:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to show amounts for period that has been filtered out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-amounts-for-period-that-has-been-filtered-out/m-p/2809397#M88820</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;, Thanks for the Reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are pretty darn close, but it's not quite there. Although, looking at it, your DAX seems solid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added an additional period table and gave it a rank column. The Max period = 1. I also joined it to FactEmployeeFiscal by FiscalPeriod.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Measure is as follows:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;You are close, but the result reflects the starting headcount for the period selected rather than for the period prior. In the pic below, the starting HC should be 3,024.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I've changed your -1 to a +1 and tried -2 and +2, but the result remains the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:56:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-amounts-for-period-that-has-been-filtered-out/m-p/2809397#M88820</guid>
      <dc:creator>tmendoza</dc:creator>
      <dc:date>2022-09-30T21:56:55Z</dc:date>
    </item>
  </channel>
</rss>

