<?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: if condition with months and positive/negative values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123911#M110901</link>
    <description>&lt;P&gt;My mistake. I started writing it as one of the other window functions and then realised that OFFSET was better, but it doesn't need REL. Just delete that line.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 12:05:33 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-03-10T12:05:33Z</dc:date>
    <item>
      <title>if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123716#M110887</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have the following results so far:&lt;/P&gt;&lt;P&gt;One column with &lt;EM&gt;Stock&lt;/EM&gt; and one with &lt;EM&gt;Forecast&lt;/EM&gt; that are comming from SQL, and a third column (BBD Risk 7-12), that is a calculated measure:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BBD Risk 7-12 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[minus BBD 7-12]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;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;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&l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N&gt;This is the result from BBD Risk 7-12 measure and the expected result:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to cumulate the result from every month until it will find a positive result from Stock-Forecast, then it will start again to cumulate the result from the next month of postive resul, until the next one.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Mar 2023 10:32:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123716#M110887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T10:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123881#M110898</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Resetting accumulator =
VAR CurrentValue = [minus BBD 7-12]
VAR PrevValue =
    CALCULATE (
        [minus BBD 7-12],
        OFFSET (
            -1,
            VALUES ( 'Calendar'[Year month] ),
            ORDERBY ( 'Calendar'[Year month], ASC )
        )
    )
RETURN
    CurrentValue + MAX ( 0, PrevValue )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:18:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123881#M110898</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-03-10T12:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123900#M110900</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp;Thnak you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in the Measure. What is REL?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:03:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123900#M110900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T12:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123911#M110901</link>
      <description>&lt;P&gt;My mistake. I started writing it as one of the other window functions and then realised that OFFSET was better, but it doesn't need REL. Just delete that line.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:05:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123911#M110901</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-03-10T12:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123939#M110902</link>
      <description>&lt;P&gt;I don't really know how to write it. Can you write it for me and explain how it works?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:15:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123939#M110902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T12:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123960#M110904</link>
      <description>&lt;P&gt;I've amended my original post to remove the REL, you should be able to use that now.&lt;/P&gt;
&lt;P&gt;It works by creating a window over the year month column from the date table and using this to find the value for the previous month. If that value is -ve then it will add it to the current value, otherwise it will just return the current value as is.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:21:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123960#M110904</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-03-10T12:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123996#M110907</link>
      <description>&lt;P&gt;Not quite what I've wanted:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the picture for July the rusult needs to be -172-105=-277&amp;nbsp; All the negative results from a month need to cumulate in the next month, until the return of a positive result.&lt;/P&gt;&lt;P&gt;Then in August 1759-109+(-277 "Cumulative result until that month)=1373&lt;/P&gt;&lt;P&gt;The in September, because in August we had a positive value, it will start again to add cumulative result, until the next positive result.&lt;/P&gt;&lt;P&gt;Maybe I didn't explain very well. If it was not understood, I can look for an explanation in another form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:37:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3123996#M110907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T12:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3124004#M110909</link>
      <description>&lt;P&gt;Also, the calculateion needs to start from the current month, like it was in my first formula:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;()),&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;()),&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[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;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:40:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3124004#M110909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T12:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3127112#M111107</link>
      <description>&lt;P&gt;So far I have this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BBD Risk = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;CurrentValue&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[minus BBD 7-12]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;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;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&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lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&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; &lt;/SPAN&gt;&lt;SPAN&gt;ORDERBY&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ASC&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;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CurrentValue&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;MAX&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;PrevValue&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The problem is that the result in a month is not reseting when in prev. month there is a positive result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;With Green is the desired result:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:35:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3127112#M111107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-13T07:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: if condition with months and positive/negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3130706#M111390</link>
      <description>&lt;P&gt;So far I have this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BBD Risk =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CurrentValue&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[minus BBD 7-12]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;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;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SP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gt;CurrentValue&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;+&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PrevValue&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The problem is that the result in a month is not reseting when in prev. month there is a positive result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;With Green is the desired result:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Mar 2023 12:36:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/if-condition-with-months-and-positive-negative-values/m-p/3130706#M111390</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-14T12:36:25Z</dc:date>
    </item>
  </channel>
</rss>

