<?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 Aging with As of Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1714333#M35394</link>
    <description>&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you think this is helpful? can you help me with what I am trying to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 15:59:13 GMT</pubDate>
    <dc:creator>abdulhadin</dc:creator>
    <dc:date>2021-03-10T15:59:13Z</dc:date>
    <item>
      <title>Inventory Aging with As of Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1705578#M35150</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can help me with this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am building an inventory aging report with the ability to specify an as of date. The way the report works, is I see the net available qty as of the date the user selects from the dropdown, and then I go back to find all the purchases that happened before the as of date, until I hit the net available qty. I find the qty that was purchased according to the aging buckets assigned. I am able to get all this to work for each line, but the total isn't showing correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried multiple formulas to resolve this without success so far. The last formula I used is this&amp;nbsp;&lt;/P&gt;&lt;P&gt;PurchaseAge01 - 00 to 30 Days =&lt;BR /&gt;var Days30 = min([AsOfDateQty], CALCULATE([AsOfDatePurchaseQty],Filter(MEINVENTAGING2, [TotalPurchaseDate] &amp;lt;= 30 )))&lt;BR /&gt;Var TotalDays30 = SUMMARIZE(MEINVENTAGING2, "30Days", Days30)&lt;/P&gt;&lt;P&gt;return&lt;BR /&gt;if(ISFILTERED(MEINVENTAGING2), Days30, SUMX(TotalDays30, [30days]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is another formula that I am using&lt;/P&gt;&lt;P&gt;PurchaseAge02 - 31 to 60 Days = if(CALCULATE([AsOfDatePurchaseQty],Filter(MEINVENTAGING2,[TotalPurchaseDate]&amp;lt;=30)) &amp;gt;= [AsOfDateQty], 0,&lt;BR /&gt;min([AsOfDateQty] -&lt;BR /&gt;CALCULATE([AsOfDatePurchaseQty],Filter(MEINVENTAGING2,[TotalPurchaseDate]&amp;lt;=30)), CALCULATE([AsOfDatePurchaseQty],Filter(MEINVENTAGING2,[TotalPurchaseDate]&amp;lt;=60))-&lt;BR /&gt;CALCULATE([AsOfDatePurchaseQty],Filter(MEINVENTAGING2,[TotalPurchaseDate]&amp;lt;=30))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to resolve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 12:18:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1705578#M35150</guid>
      <dc:creator>abdulhadin</dc:creator>
      <dc:date>2021-03-05T12:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Aging with As of Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1705957#M35172</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="288920" data-lia-user-login="abdulhadin" class="lia-mention lia-mention-user"&gt;abdulhadin&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you need bucketing/binning on measure using an independent table.&lt;/P&gt;
&lt;P&gt;Refer if this video of blog can help to get the approach&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=CuczXPj0N-k" target="_blank"&gt;https://www.youtube.com/watch?v=CuczXPj0N-k&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.daxpatterns.com/dynamic-segmentation/" target="_blank"&gt;https://www.daxpatterns.com/dynamic-segmentation/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/grouping-and-binning-step-towards-better-data-visualization" target="_blank"&gt;https://radacad.com/grouping-and-binning-step-towards-better-data-visualization&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 15:36:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1705957#M35172</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-03-05T15:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Aging with As of Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1707121#M35225</link>
      <description>&lt;P&gt;Thank you for your help, I will take a look at it, and see if I can use them in my solution, if not then I will create a sample pbix file. The issue is I don't alway have access to the data, so I will have to wait until tomorrow to try it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 07 Mar 2021 04:37:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1707121#M35225</guid>
      <dc:creator>abdulhadin</dc:creator>
      <dc:date>2021-03-07T04:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Aging with As of Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1708270#M35253</link>
      <description>&lt;P&gt;Ok Here is a sample data, I am still not able to figure this out&lt;BR /&gt;&lt;BR /&gt;Item Item group DatePhysical Qty Issue Receipt&lt;BR /&gt;123 Abc 2/3/2021 -4 1 0&lt;BR /&gt;123 Abc 1/26/2021 -6 1 0&lt;BR /&gt;123 Abc 1/26/2021 2 0 1&lt;BR /&gt;123 Abc 1/23/2021 -1 1 0&lt;BR /&gt;123 Abc 1/21/2021 -1 1 0&lt;BR /&gt;123 Abc 11/26/2020 12 0 1&lt;BR /&gt;123 Abc 11/25/2020 1 0 1&lt;BR /&gt;123 Abc 11/25/2020 -6 1 0&lt;BR /&gt;123 Abc 11/15/2020 6 0 1&lt;BR /&gt;456 Abc 1/18/2021 2 0 1&lt;BR /&gt;456 Abc 1/8/2021 -3 1 0&lt;BR /&gt;456 Abc 1/7/2021 3 1 0&lt;BR /&gt;456 Abc 6/17/2020 2 0 1&lt;BR /&gt;456 Abc 6/17/2020 -2 1 0&lt;BR /&gt;Sample data&lt;BR /&gt;&lt;BR /&gt;Sample output:&lt;BR /&gt;In the date dropdown I am only showing End of month dates&lt;BR /&gt;If the date dropdown selected is 2/28/2021:&lt;BR /&gt;Item group Item Qty 0-30 30-60 60-90 90+&lt;BR /&gt;Abc 123 3 0 2 0 1&lt;BR /&gt;Abc 456 2 0 2 0 0&lt;BR /&gt;Total 5 0 4 0 1&lt;BR /&gt;&lt;BR /&gt;If the date dropdown selected is 1/31/2021:&lt;BR /&gt;Item group Item Qty 0-30 30-60 60-90 90+&lt;BR /&gt;Abc 123 7 2 0 5 0&lt;BR /&gt;Abc 456 2 2 0 0 0&lt;BR /&gt;Total 9 4 0 5 0&lt;BR /&gt;&lt;BR /&gt;If the date dropdown selected is 12/31/2020:&lt;BR /&gt;Item group Item Qty 0-30 30-60 60-90 90+&lt;BR /&gt;Abc 123 13 0 13 0 0&lt;BR /&gt;Total 13 0 13 0 0&lt;BR /&gt;&lt;BR /&gt;I also have a separate calendar table.&lt;BR /&gt;&lt;BR /&gt;Current measures:&lt;BR /&gt;As of date = var CurrentEndDate = max(MEINVENTAGING2[DATEPHYSICAL])&lt;BR /&gt;return&lt;BR /&gt;if(HASONEVALUE(DateCalendar[EOM]),VALUES(DateCalendar[eom]),CurrentEndDate)&lt;BR /&gt;&lt;BR /&gt;TotalPurchaseDate = round([AsOfDate] - CALCULATE(MAX(MEINVENTAGING2[DATEPHYSICAL]), FILTER(MEINVENTAGING2, MEINVENTAGING2[STATUSRECEIPT] &amp;lt;&amp;gt; 0)),0)&lt;BR /&gt;&lt;BR /&gt;AsOfDatePurchaseQty = CALCULATE(sum(MEINVENTAGING2[SUMOFQTY]),FILTER(MEINVENTAGING2, [TotalPurchaseDate] &amp;gt;= 0))&lt;BR /&gt;&lt;BR /&gt;TotalDaysOpen = round([AsOfDate] - max(MEINVENTAGING2[DATEPHYSICAL]),0)&lt;BR /&gt;AsOfDateQty = CALCULATE(sum(MEINVENTAGING2[SUMOFQTY]),FILTER(MEINVENTAGING2,[TotalDaysOpen] &amp;lt;= 99999),FILTER(MEINVENTAGING2, [TotalDaysOpen] &amp;gt;= 0))&lt;BR /&gt;&lt;BR /&gt;Now I am struggling with how to calculate the 0-30, 30-60 and so on. It is working fine for per item but at the total level, the total qty is correct, but the buckets aren't correct, it is grouping everything under the 0-30 and the rest of the buckets are empty.&lt;BR /&gt;&lt;BR /&gt;Here is what I have for 0-30&lt;BR /&gt;PurchaseAge01 - 00 to 30 Days =&lt;BR /&gt;var Days30 = min([AsOfDateQty], CALCULATE([AsOfDatePurchaseQty],Filter(MEINVENTAGING2, [TotalPurchaseDate] &amp;lt;= 30 )))&lt;BR /&gt;Var TotalDays30 = SUMMARIZE(MEINVENTAGING2, "30Days", Days30)&lt;BR /&gt;return&lt;BR /&gt;if(ISFILTERED(MEINVENTAGING2), Days30, SUMX(TotalDays30, [30days]))&lt;BR /&gt;&lt;BR /&gt;For Issue and receipt columns, the Issue is for when inventory is removed and Receipt is when inventory is received.&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help and sorry for the long message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 07:32:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1708270#M35253</guid>
      <dc:creator>abdulhadin</dc:creator>
      <dc:date>2021-03-08T07:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Aging with As of Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1714333#M35394</link>
      <description>&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you think this is helpful? can you help me with what I am trying to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 15:59:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Inventory-Aging-with-As-of-Date/m-p/1714333#M35394</guid>
      <dc:creator>abdulhadin</dc:creator>
      <dc:date>2021-03-10T15:59:13Z</dc:date>
    </item>
  </channel>
</rss>

