<?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: Dynamic latest load variable for Full Year forecast in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2778516#M86872</link>
    <description>&lt;P&gt;Figured it out! changed the latest_forecast variable to match the load date quarter -1 selected value on the slicer and added the extra filter within the CALCULATE&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2022 18:28:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-19T18:28:53Z</dc:date>
    <item>
      <title>Dynamic latest load variable for Full Year forecast</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2777392#M86747</link>
      <description>&lt;P&gt;I have a table I'm showing which has several lines, all of which are measures including Actual Sales YTD and Forecast Sales Full Year.&lt;/P&gt;&lt;P&gt;The data is loaded right after the end of the previous quarter (Q1 data is loaded on April 1st)&lt;/P&gt;&lt;P&gt;The calculation for Actual Sales YTD is quite simple (Sum of all sales for this year until previous quarter).&lt;/P&gt;&lt;P&gt;The calculation for Forecast is Actuals up to previous quarter than Forecast for the end of the year.&lt;/P&gt;&lt;P&gt;Here is a simplified version of that data&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Index&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Effective Quarter&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;TD&gt;LoadDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;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&gt;So at the end of Q1&lt;/P&gt;&lt;P&gt;Actual Sales YTD: 75&lt;/P&gt;&lt;P&gt;Forecast Full Year: (75+60+65+70) 270&lt;/P&gt;&lt;P&gt;And at the end of Q2&lt;/P&gt;&lt;P&gt;Actual Sales: 138 (75+63)&lt;/P&gt;&lt;P&gt;Forecast Full Year: 278&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since we have several forecasts during the year I can't just add up the rows called forecast so I have a Latest_Forecast variable which helps me dtermine to only add the right forecast&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Latest_Forecast =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MAXX&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;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Sales Data',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Sales Data'[Type] = &lt;/SPAN&gt;&lt;SPAN&gt;"Forecast"&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;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Sales Data'[LoadDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My problem (finally I get to it), is that the user now wants to be able to go back to previous quarters and still see the right Forecast for year end.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So right now if I select Q1 it will give me 215 (75 + 68+72) because as far as the latest_forecast is concerned thats the Latest forecast (and also it doesnt contain any Q2 values)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How can I change the variable to group together the rows per quarter to determine what the latest forecast is per quarter?&lt;BR /&gt;It also doesnt help that the table i put above is heavily simplified when it reality there are thousands of rows that make up the actuals and forecast per quarter.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help would be much appreciated and please let me know if I can clarify further, it's a bit of a doozy to explain and I'm afraid I might now have done a great job of laying it out.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Sep 2022 16:21:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2777392#M86747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-19T16:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic latest load variable for Full Year forecast</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2778138#M86819</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , With help from a date table, try measure like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actual +forecast = &lt;BR /&gt;var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())&lt;BR /&gt;var _min = eomonth(_max,-1*MONTH(_max))+1 &lt;BR /&gt;var _YED = eomonth(_max,12-1*MONTH(_max))&lt;BR /&gt;return&lt;BR /&gt;CALCULATE(Sum(Table[Amount]), filter(Table, [Type] = "Actual") ,DATESBETWEEN('Date'[Date],_min,_max)) +&lt;BR /&gt;CALCULATE(Sum(Table[Amount]), filter(Table, [Type] = "Forecast") ,DATESBETWEEN('Date'[Date],_max+1,_YED))&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 15:43:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2778138#M86819</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-19T15:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic latest load variable for Full Year forecast</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2778208#M86827</link>
      <description>&lt;P&gt;Maybe I'm missing something but I feel like that measure filters on the right dates but doesn't take in consideration the multiple forecast loads. How does it know which load date to use?&lt;/P&gt;&lt;P&gt;If I select to view data from Q1 it should use the Apr-1 loaddate but if I select Q2 it should be using the Jul-1 loaddate (and so on and so forth)&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 16:14:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2778208#M86827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-19T16:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic latest load variable for Full Year forecast</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2778516#M86872</link>
      <description>&lt;P&gt;Figured it out! changed the latest_forecast variable to match the load date quarter -1 selected value on the slicer and added the extra filter within the CALCULATE&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 18:28:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-latest-load-variable-for-Full-Year-forecast/m-p/2778516#M86872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-19T18:28:53Z</dc:date>
    </item>
  </channel>
</rss>

