<?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: Cumulative value with conditions (or other solution) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-value-with-conditions-or-other-solution/m-p/2386665#M61859</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;=&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CLOSINGBALANCEMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Final_Stock]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Dates[Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CLOSINGBALANCEMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Final_stock]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Dates[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 10 Mar 2022 15:14:13 GMT</pubDate>
    <dc:creator>Whitewater100</dc:creator>
    <dc:date>2022-03-10T15:14:13Z</dc:date>
    <item>
      <title>Cumulative value with conditions (or other solution)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-value-with-conditions-or-other-solution/m-p/2386605#M61854</link>
      <description>&lt;P&gt;Hello fellows! I have little experiencie with DAX. I've been trying to create an expression to solve my problem.&lt;/P&gt;&lt;P&gt;I have a 3 tables.&lt;/P&gt;&lt;P&gt;Initial Stock (not linked with DateTable, because it is a snapshot of my current stock position)&lt;/P&gt;&lt;P&gt;Transit (linked with DateTable)&lt;/P&gt;&lt;P&gt;Demand (linked as well)&lt;/P&gt;&lt;P&gt;Final_Stock ( Initial Stock + Transit - Demand)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is where I'm stucked, what I've been trying to accomplish.&lt;/P&gt;&lt;P&gt;I have the initial stock and did the measure to give me the Final Stock for this month (Initial Stock + Transit - Demand) .&lt;/P&gt;&lt;P&gt;However, for the calculation for the next months, the initial stock to be considered should be the final stock from previous month.&lt;/P&gt;&lt;P&gt;The biggest problem I'm facing:&amp;nbsp;If the final stock from previous month is negative, the next month should considere 0 as the initial stock and start over the process again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did and is not working well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cumulative Total = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Medidas&lt;/SPAN&gt;&lt;SPAN&gt;[Final_Stock]&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; &amp;nbsp; &amp;nbsp;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&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; &amp;nbsp; &amp;nbsp;'Date'[Date]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'[Date]&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; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I tried to create a conditional formula, but is not working correctly.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appretiated!!!&lt;/P&gt;&lt;P&gt;Thank you all.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Mar 2022 14:57:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-value-with-conditions-or-other-solution/m-p/2386605#M61854</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T14:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative value with conditions (or other solution)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-value-with-conditions-or-other-solution/m-p/2386665#M61859</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;=&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CLOSINGBALANCEMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Final_Stock]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Dates[Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CLOSINGBALANCEMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Final_stock]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Dates[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Mar 2022 15:14:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-value-with-conditions-or-other-solution/m-p/2386665#M61859</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-03-10T15:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative value with conditions (or other solution)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-value-with-conditions-or-other-solution/m-p/2386686#M61860</link>
      <description>&lt;P&gt;no... it is repating the value across the months&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>Thu, 10 Mar 2022 15:19:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-value-with-conditions-or-other-solution/m-p/2386686#M61860</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T15:19:41Z</dc:date>
    </item>
  </channel>
</rss>

