<?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: Inventory Forecast Weekly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4091325#M162373</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="780812" data-lia-user-login="JGomez_2012" class="lia-mention lia-mention-user"&gt;JGomez_2012&lt;/a&gt;&amp;nbsp;，&lt;BR /&gt;Please share the pbix sample file for better testing.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2024 09:28:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-09T09:28:12Z</dc:date>
    <item>
      <title>Inventory Forecast Weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4076004#M161836</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a weekly forecast of my inventory based on 3 tables:&lt;/P&gt;&lt;P&gt;Actual Inventory&lt;/P&gt;&lt;P&gt;Arrived Orders&lt;/P&gt;&lt;P&gt;Sale Forecast&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The structure of the tables is like this:&lt;/P&gt;&lt;P&gt;Actual Inventory (&lt;/P&gt;&lt;P&gt;item varchar(),&lt;/P&gt;&lt;P&gt;loc varchar()&lt;/P&gt;&lt;P&gt;quantity_on_hand int&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales Forecast&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;item varchar()&lt;/P&gt;&lt;P&gt;loc varchar()&lt;/P&gt;&lt;P&gt;MontlySales int&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Arrived Orders&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;item varchar()&lt;/P&gt;&lt;P&gt;loc varchar()&lt;/P&gt;&lt;P&gt;quantity_expected int&lt;/P&gt;&lt;P&gt;expected_date datetime&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on this information i have to project the next 6 months on a weekly basis.&amp;nbsp; My actual problem is that i need the inventory for next week is the result of&amp;nbsp; the following measures:&amp;nbsp; Week_forecast = initial_inventory + orders_to_come - weekly_forecast.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a CalendarDate table to follow all the measures in the timeframe. All the tables are related on item + loc and the CalendarDate is related to the Arrived Orders table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what i'm getting in power bi&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;when i should be getting this.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone knows i way where i can do like a cycle or something to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 12:45:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4076004#M161836</guid>
      <dc:creator>JGomez_2012</dc:creator>
      <dc:date>2024-08-02T12:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Forecast Weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4076022#M161838</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a similar situation to yours and solved it like this: maybe this will work for you too?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first i made a Weekly Sales Forecast.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Weekly_Sales_Forecast = &lt;BR /&gt;VAR MonthlyForecast = SUM('Sales Forecast'[MontlySales])&lt;BR /&gt;VAR DaysInMonth = DAY(EOMONTH(MIN('CalendarDate'[Date]), 0))&lt;BR /&gt;VAR DaysInWeek = COUNTROWS(VALUES('CalendarDate'[Date]))&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE(MonthlyForecast, DaysInMonth, 0) * DaysInWeek&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then a measure to calculate the quanity of orders each week:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Weekly_Arrivals = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Arrived Orders'[quantity_expected]),&lt;BR /&gt;FILTER(&lt;BR /&gt;'Arrived Orders',&lt;BR /&gt;'Arrived Orders'[expected_date] &amp;gt;= MIN('CalendarDate'[Date]) &amp;amp;&amp;amp;&lt;BR /&gt;'Arrived Orders'[expected_date] &amp;lt;= MAX('CalendarDate'[Date])&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then an initial inventory for each item at the start of the week:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Initial_Inventory = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Actual Inventory'[quantity_on_hand]),&lt;BR /&gt;FILTER(&lt;BR /&gt;'Actual Inventory',&lt;BR /&gt;'Actual Inventory'[item] = MAX('CalendarDate'[item]) &amp;amp;&amp;amp;&lt;BR /&gt;'Actual Inventory'[loc] = MAX('CalendarDate'[loc])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then combined it to get the weekly forecast&lt;/P&gt;&lt;PRE&gt;Weekly_Forecasted_Inventory = &lt;BR /&gt;VAR InitialInventory = [Initial_Inventory]&lt;BR /&gt;VAR WeeklyArrivals = [Weekly_Arrivals]&lt;BR /&gt;VAR WeeklySalesForecast = [Weekly_Sales_Forecast]&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;InitialInventory + WeeklyArrivals - WeeklySalesForecast&lt;/PRE&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 13:03:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4076022#M161838</guid>
      <dc:creator>PurpleGate</dc:creator>
      <dc:date>2024-08-02T13:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Forecast Weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4076062#M161841</link>
      <description>&lt;P&gt;Thanks for your answer, but got the same issue the weekly forecast is not moving forward.&amp;nbsp; with your measures i have the same results that i had before.&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>Fri, 02 Aug 2024 13:21:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4076062#M161841</guid>
      <dc:creator>JGomez_2012</dc:creator>
      <dc:date>2024-08-02T13:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Forecast Weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4091325#M162373</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="780812" data-lia-user-login="JGomez_2012" class="lia-mention lia-mention-user"&gt;JGomez_2012&lt;/a&gt;&amp;nbsp;，&lt;BR /&gt;Please share the pbix sample file for better testing.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 09:28:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Forecast-Weekly/m-p/4091325#M162373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-09T09:28:12Z</dc:date>
    </item>
  </channel>
</rss>

