<?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 formula returning unexpected result for negative values (summarizing all unique negative values) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2812641#M89072</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="447140" data-lia-user-login="hansdunnik" class="lia-mention lia-mention-user"&gt;hansdunnik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to display the "Total" in the visual . And in this sample data ,the total is "-3". Right?&lt;/P&gt;
&lt;P&gt;Here are the steps you can refer to :&lt;/P&gt;
&lt;P&gt;(1)This is my test data:&amp;nbsp; 'Sheet1' Table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We can click "New Table" to create a table :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = SUMMARIZE('Sheet1','Sheet1'[Currency] , "value" ,IF( SUM('Sheet1'[Value]) &amp;lt;0 ,SUM('Sheet1'[Value]),BLANK())   )&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can put the fields&amp;nbsp; in 'Table2' , then we can meet your need :&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 01:25:37 GMT</pubDate>
    <dc:creator>v-yueyunzh-msft</dc:creator>
    <dc:date>2022-10-03T01:25:37Z</dc:date>
    <item>
      <title>If formula returning unexpected result for negative values (summarizing all unique negative values)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2793911#M87745</link>
      <description>&lt;P&gt;I have the following values (simplistic).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currency&amp;nbsp; &amp;nbsp;Value&lt;/P&gt;&lt;P&gt;EUR&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;EUR&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -5&lt;/P&gt;&lt;P&gt;USD&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -3&lt;/P&gt;&lt;P&gt;JPY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;JPY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column in Power BI where i want to find the total of value per currency, this will show as following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EUR&amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;USD&amp;nbsp; &amp;nbsp; &amp;nbsp;-3&lt;/P&gt;&lt;P&gt;JPY&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i want now is to add a new column or measure and I would like to apply an IF statement.&lt;/P&gt;&lt;P&gt;If total value per currency is less than zero, then show this total value per currency, otherwise show 0 or blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i want to see is this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EUR 0 or blank&lt;/P&gt;&lt;P&gt;USD -3&lt;/P&gt;&lt;P&gt;JPY 0 or blank&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it does not matter which DAX formula I try, but it is giving the wrong output and mostly it will show me the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EUR -5&lt;/P&gt;&lt;P&gt;USD -3&lt;/P&gt;&lt;P&gt;JPY -4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is showing the negative values per currency, but i would like the DAX to keep on to the cumulated totals and then only apply the IF statement... but that is not working out for me &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone guide me into a similar question and answer or help me with a sample formula ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 19:52:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2793911#M87745</guid>
      <dc:creator>hansdunnik</dc:creator>
      <dc:date>2022-09-25T19:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: If formula returning unexpected result for negative values (summarizing all unique negative values)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2794885#M87785</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="447140" data-lia-user-login="hansdunnik" class="lia-mention lia-mention-user"&gt;hansdunnik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to convert the sum of [&lt;SPAN&gt;Value&lt;/SPAN&gt;] to the BLANK() which is less than 0. Right?&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow:&lt;/P&gt;
&lt;P&gt;(1)This is my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) If you want to show in a table ,you can click "New Table" and enter:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = SUMMARIZE('Table','Table'[Currency] , "value" ,IF( SUM('Table'[Value]) &amp;lt;0 ,SUM('Table'[Value]),BLANK())   )&lt;/LI-CODE&gt;
&lt;P&gt;The result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(3)If you want to show in a visual ,you can click "New measure" and enter:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;v = IF( SUM('Table'[Value]) &amp;lt;0 , SUM('Table'[Value]),BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;Then we can put the [v] measure and the [Currency] field in the table visual, the result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 03:10:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2794885#M87785</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-09-26T03:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: If formula returning unexpected result for negative values (summarizing all unique negative values)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2808615#M88756</link>
      <description>&lt;P&gt;I am sorry Aniya for not replying earlier. I only found time today to look into it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This did help me to get to the next step. I am seeing indeed now the&amp;nbsp; USD -3 that I want to see....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it is not getting me a Totalized amount in the column. Even when changing BLANK into 0 in the measure formula, it shows me zero. So probably I need another fix in the formula in the last part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently you had:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;v = IF( SUM('Table'[Value]) &amp;lt;0 , SUM('Table'[Value]),BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably the last part needs to be updated somehow, to also show -3 in the total line ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;v = IF( SUM('Table'[Value]) &amp;lt;0 , SUM('Table'[Value]),??????())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 13:47:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2808615#M88756</guid>
      <dc:creator>hansdunnik</dc:creator>
      <dc:date>2022-09-30T13:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: If formula returning unexpected result for negative values (summarizing all unique negative values)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2812641#M89072</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="447140" data-lia-user-login="hansdunnik" class="lia-mention lia-mention-user"&gt;hansdunnik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to display the "Total" in the visual . And in this sample data ,the total is "-3". Right?&lt;/P&gt;
&lt;P&gt;Here are the steps you can refer to :&lt;/P&gt;
&lt;P&gt;(1)This is my test data:&amp;nbsp; 'Sheet1' Table&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)We can click "New Table" to create a table :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = SUMMARIZE('Sheet1','Sheet1'[Currency] , "value" ,IF( SUM('Sheet1'[Value]) &amp;lt;0 ,SUM('Sheet1'[Value]),BLANK())   )&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can put the fields&amp;nbsp; in 'Table2' , then we can meet your need :&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 01:25:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-formula-returning-unexpected-result-for-negative-values/m-p/2812641#M89072</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-10-03T01:25:37Z</dc:date>
    </item>
  </channel>
</rss>

