<?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: Track Stock amount in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3625747#M140203</link>
    <description>&lt;P&gt;&lt;FONT size="5"&gt;&lt;SPAN&gt;Track Stock amount&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Helo &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;, thank you so much for your effort. In my simple example scenario it works perfectly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway i still have issues with your solution. It only works when the offset between changes in stock amount are no more then 1 day. To show what i mean, i have slightly adjusted the sample data.&lt;/P&gt;&lt;P&gt;Fact table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example visual:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, there doesnt seem to be any stock for 220 at the 08. of december, but there are actually still 3 pieces 06. december.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And finally one more point: I couldnt find a way to sum up the result of the measure 'sum adjusted'.&lt;/P&gt;&lt;P&gt;But in the end i need a visual which only shows one bar per day, whichs means ill have to sum up over all products on that day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help me out on that. If there are remaining questions reach out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with kind regards.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2024 09:28:42 GMT</pubDate>
    <dc:creator>JoRose</dc:creator>
    <dc:date>2024-01-24T09:28:42Z</dc:date>
    <item>
      <title>Track Stock amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598525#M139044</link>
      <description>&lt;P&gt;Dear DAX/Power BI Community,&lt;/P&gt;&lt;P&gt;I have the following issue. I want to record warehouse stock on a daily basis. To restrict the amount of new entries in the database, i want to record only those products which quantity changed since the last update. The point i am struggeling with is: when i have a product which didnt change in quantity over a few days, it still needs to be counted as in stock with the quantityamount from the last date with a record for the given product.&lt;/P&gt;&lt;P&gt;The data in the Database could look 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;&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;&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;As you can see the ProductID 220 has no entry for the 05.12 which means that its quantity is still 1.&lt;/P&gt;&lt;P&gt;The DAX formula should respect this and evaluate to the following result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&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;&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;The underlying tabular datamodel 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;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what i need is a measure that can deliver the result shown in the diagram.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas are highly appreciated. I am really stuck right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help and a Merry Christmas to you all!!!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 13:55:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598525#M139044</guid>
      <dc:creator>JoRose</dc:creator>
      <dc:date>2023-12-22T13:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Track Stock amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598776#M139054</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="610854" data-lia-user-login="JoRose" class="lia-mention lia-mention-user"&gt;JoRose&lt;/a&gt;&amp;nbsp;what is your request?&lt;/P&gt;
&lt;P&gt;You wrote "&lt;SPAN&gt;&amp;nbsp;want to record only those products which quantity changed since the last update." so you want to flag something like calculate / include / exclude... provide expected output in table view (later you can do visuals)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 13:08:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598776#M139054</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-12-22T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Track Stock amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598819#M139057</link>
      <description>&lt;P&gt;Hey &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;, i have updated my post. What i need is a measure that can calculate the result the shown in the diargam.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 14:01:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598819#M139057</guid>
      <dc:creator>JoRose</dc:creator>
      <dc:date>2023-12-22T14:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Track Stock amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598847#M139058</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="610854" data-lia-user-login="JoRose" class="lia-mention lia-mention-user"&gt;JoRose&lt;/a&gt;&amp;nbsp;I created two measure, based on your sample data, as following&lt;/P&gt;
&lt;P&gt;Adjust your proper fact / Calendar tables names and you should get output from Output (Date from Date table, not fact)&lt;/P&gt;
&lt;P&gt;1.&amp;n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[Simple simple]&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 14:20:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3598847#M139058</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-12-22T14:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Track Stock amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3625747#M140203</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;&lt;SPAN&gt;Track Stock amount&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Helo &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555045" data-lia-user-login="some_bih" class="lia-mention lia-mention-user"&gt;some_bih&lt;/a&gt;, thank you so much for your effort. In my simple example scenario it works perfectly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway i still have issues with your solution. It only works when the offset between changes in stock amount are no more then 1 day. To show what i mean, i have slightly adjusted the sample data.&lt;/P&gt;&lt;P&gt;Fact table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example visual:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, there doesnt seem to be any stock for 220 at the 08. of december, but there are actually still 3 pieces 06. december.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And finally one more point: I couldnt find a way to sum up the result of the measure 'sum adjusted'.&lt;/P&gt;&lt;P&gt;But in the end i need a visual which only shows one bar per day, whichs means ill have to sum up over all products on that day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help me out on that. If there are remaining questions reach out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with kind regards.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 09:28:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3625747#M140203</guid>
      <dc:creator>JoRose</dc:creator>
      <dc:date>2024-01-24T09:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Track Stock amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3633535#M140540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="610854" data-lia-user-login="JoRose" class="lia-mention lia-mention-user"&gt;JoRose&lt;/a&gt;&amp;nbsp;thank you for reaching.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am busy these days, but I will take a look and let you know. I hope you understand.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:19:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Track-Stock-amount/m-p/3633535#M140540</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2024-01-11T14:19:59Z</dc:date>
    </item>
  </channel>
</rss>

