<?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 Error in dax formula with counting sales growth with negative values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-dax-formula-with-counting-sales-growth-with-negative/m-p/2321848#M58013</link>
    <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;Profit in 2022: 51&lt;/P&gt;&lt;P&gt;Proft in 2021: (-31)&lt;/P&gt;&lt;P&gt;How to calculate growth YoY?&amp;nbsp;&lt;/P&gt;&lt;P&gt;My actual function is as below:&lt;/P&gt;&lt;P&gt;=DIVIDE(PROFIT 2022, PROFIT 2021,BLANK())&lt;/P&gt;&lt;P&gt;But the result of this calculation is wrong, because it is (-277%), the&amp;nbsp;profit is on the upside, so the result must be positive.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 06 Feb 2022 19:55:00 GMT</pubDate>
    <dc:creator>Asmoday1507</dc:creator>
    <dc:date>2022-02-06T19:55:00Z</dc:date>
    <item>
      <title>Error in dax formula with counting sales growth with negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-dax-formula-with-counting-sales-growth-with-negative/m-p/2321848#M58013</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;Profit in 2022: 51&lt;/P&gt;&lt;P&gt;Proft in 2021: (-31)&lt;/P&gt;&lt;P&gt;How to calculate growth YoY?&amp;nbsp;&lt;/P&gt;&lt;P&gt;My actual function is as below:&lt;/P&gt;&lt;P&gt;=DIVIDE(PROFIT 2022, PROFIT 2021,BLANK())&lt;/P&gt;&lt;P&gt;But the result of this calculation is wrong, because it is (-277%), the&amp;nbsp;profit is on the upside, so the result must be positive.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Feb 2022 19:55:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-dax-formula-with-counting-sales-growth-with-negative/m-p/2321848#M58013</guid>
      <dc:creator>Asmoday1507</dc:creator>
      <dc:date>2022-02-06T19:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error in dax formula with counting sales growth with negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-dax-formula-with-counting-sales-growth-with-negative/m-p/2322097#M58018</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343460" data-lia-user-login="Asmoday1507" class="lia-mention lia-mention-user"&gt;Asmoday1507&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is really a question of what convention you want to follow when calculating growth rates between profit values when either one is negative. I recommend getting the opinion of the consumers of your report(s) to see what they would expect in such cases.&lt;/P&gt;
&lt;P&gt;There is an old &lt;A href="https://www.wsj.com/public/resources/documents/doe-help.htm#netincome" target="_blank" rel="noopener"&gt;Wall Street Journal convention&lt;/A&gt;, which states that percentage growth should not be shown for profit values when either the current or prior value is negative.&lt;/P&gt;
&lt;P&gt;There is another convention I have seen where the absolute value of the prior value is used in the denominator, however I think this could give misleading results.&lt;/P&gt;
&lt;P&gt;Personally, I would recommend returning a blank result if the percentage doesn't make sense due to negative numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In DAX, something like this would achieve this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=
VAR ProfitCurrent = [Profit Current]
VAR ProfitPrior = [Profit Prior]
RETURN
    IF (
        OR ( ProfitCurrent &amp;lt; 0, ProfitPrior &amp;lt; 0 ),
        DIVIDE ( ProfitCurrent, ProfitPrior ) -- Automatic blank if ProfitPrior = 0
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, not sure if you want to subtract 1 from the result of DIVIDE to give a growth rate rather than a ratio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those are some thoughts anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 02:11:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-dax-formula-with-counting-sales-growth-with-negative/m-p/2322097#M58018</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2022-02-07T02:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error in dax formula with counting sales growth with negative values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-dax-formula-with-counting-sales-growth-with-negative/m-p/2322236#M58021</link>
      <description>&lt;P&gt;&lt;SPAN&gt;=DIVIDE(PROFIT 2022-PROFIT 2021, ABS(PROFIT 2021),BLANK())&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 04:04:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-in-dax-formula-with-counting-sales-growth-with-negative/m-p/2322236#M58021</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2022-02-07T04:04:52Z</dc:date>
    </item>
  </channel>
</rss>

