<?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: sum function ignoring nagetive values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413685#M175287</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&amp;nbsp; Thanks alot for&amp;nbsp; detail analysis and pointing out the data that I missed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I mentioned in other replies . I got data format issue which was not measure . I was analysis my results both in power bi and pivot table . I found different result.&lt;/P&gt;&lt;P&gt;After I asked for help. I refresh database . The row with a nagetive value was remove and I got the same result.&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="752610" data-lia-user-login="powerbidev123" class="lia-mention lia-mention-user"&gt;powerbidev123&lt;/a&gt;&amp;nbsp; Thanks alot again&amp;nbsp; All of&amp;nbsp; you people for contribution. and every suggestion&amp;nbsp; from you people is the solution to related problems.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2025 11:21:57 GMT</pubDate>
    <dc:creator>mohsin-raza</dc:creator>
    <dc:date>2025-02-17T11:21:57Z</dc:date>
    <item>
      <title>sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413560#M175278</link>
      <description>&lt;P&gt;Hello .&lt;/P&gt;&lt;P&gt;I try sum function to find sum of SKU in the following table. In&amp;nbsp; excel pivot table&amp;nbsp; sum function&amp;nbsp; shows &lt;STRONG&gt;BD6-24E = 29&lt;/STRONG&gt; while in power bi sum function show &lt;STRONG&gt;BD6-24E = 30.&amp;nbsp; Can somebody please help me ? I tested calculate and by changing quantity format to decimal. it shows the same result.&lt;/STRONG&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;&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;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mohsin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:19:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413560#M175278</guid>
      <dc:creator>mohsin-raza</dc:creator>
      <dc:date>2025-02-17T10:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413641#M175280</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="303413" data-lia-user-login="mohsin-raza" class="lia-mention lia-mention-user"&gt;mohsin-raza&lt;/a&gt;&amp;nbsp;, Can you share your DAX.&lt;/P&gt;&lt;P&gt;I am getting the expected value i.e 29&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:58:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413641#M175280</guid>
      <dc:creator>powerbidev123</dc:creator>
      <dc:date>2025-02-17T10:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413659#M175282</link>
      <description>&lt;P&gt;Dear &amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="303413" data-lia-user-login="mohsin-raza" class="lia-mention lia-mention-user"&gt;mohsin-raza&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The discrepancy likely arises from how Excel and Power BI handle data aggregation, especially if there are negative or repeated values. Let's break it down:&lt;/P&gt;
&lt;H3&gt;Values for BD6-24E:&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;24&lt;/LI&gt;
&lt;LI&gt;24&lt;/LI&gt;
&lt;LI&gt;6&lt;/LI&gt;
&lt;LI&gt;12&lt;/LI&gt;
&lt;LI&gt;-1&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Excel Pivot Table Calculation (Showing 29):&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If Excel is ignoring the negative value (or potentially applying a filter or a distinct count), it might sum as:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;24 + 24 + 6 + 12 = 66&amp;nbsp;minus the -1&amp;nbsp;&amp;nbsp;gives 65.&lt;BR /&gt;However, if Excel applies a different aggregation rule, it could ignore the repeated 24 or exclude the negative value.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Power BI Calculation (Showing 30):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;Power BI's default SUM() should sum all visible rows:&lt;BR /&gt;24 + 24 + 6 + 12 + (-1) = 65. If it shows 30,&amp;nbsp;there might be a filter context, data type issue, or incorrect aggregation in the measure.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Troubleshooting Steps:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Check the Pivot Table Settings in Excel:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Right-click Pivot Table → Field Settings → Summarize Values By → Sum.&lt;/LI&gt;
&lt;LI&gt;Check if any value filters or calculated fields are applied.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;In Power BI, use a DAX measure like this to ignore negative values:&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;Total_BD6_24E = 
CALCULATE(
    SUM('Table'[Quantity]),
    'Table'[SKU] = "BD6-24E",
    'Table'[Quantity] &amp;gt;= 0
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Ensure Data Types Match:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Confirm the quantity&amp;nbsp;column is a numeric field in Power BI.&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Recheck Data in Power BI:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use a table visual to inspect actual row values.
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark this post as solution if it helps you. Appreciate Kudos.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:05:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413659#M175282</guid>
      <dc:creator>FarhanJeelani</dc:creator>
      <dc:date>2025-02-17T11:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413660#M175283</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="752610" data-lia-user-login="powerbidev123" class="lia-mention lia-mention-user"&gt;powerbidev123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks alot for your feed back. I refresh the database . Now I get the same answer&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:05:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413660#M175283</guid>
      <dc:creator>mohsin-raza</dc:creator>
      <dc:date>2025-02-17T11:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413663#M175284</link>
      <description>&lt;P&gt;Please provide example data as text (not a screen print).&lt;/P&gt;
&lt;P&gt;With screen print proof of the Exvel formula, DAX formula&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note you have only highlighted some of&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;BD6-24E&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;rows&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Check carefully for lower case and trailing spaces because&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Power BI is not case sensitive and ignores trailing spaces, where as EXCEL does not.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So in this example Excel would give a&amp;nbsp;sum&amp;nbsp;&lt;STRONG&gt;BD6-24E &lt;/STRONG&gt;= 11 +5 = 16&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Whereas Power BI = 11 +&amp;nbsp; 5 - 4 - 3 - 2 - 1 = 6 !&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;BD6-24E = 11&lt;BR /&gt;&amp;nbsp;BD6-24E = 5&lt;BR /&gt;&amp;nbsp;Bd6-24e&amp;nbsp; = - 4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;BD6-24E space = -3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;BD6-24E space space - 2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;BD6-24E space space - 1&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&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;
&lt;P&gt;Please click thumbs up foerthese suggestions.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;also click accept solution if they work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can acceot more than one solution.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:06:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413663#M175284</guid>
      <dc:creator>speedramps</dc:creator>
      <dc:date>2025-02-17T11:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413666#M175285</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp; Thanks alot for your detail analysis and solution. Yes there was issue&amp;nbsp; with data format back in database. I refresh the database . it is solved&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:09:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413666#M175285</guid>
      <dc:creator>mohsin-raza</dc:creator>
      <dc:date>2025-02-17T11:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413685#M175287</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&amp;nbsp; Thanks alot for&amp;nbsp; detail analysis and pointing out the data that I missed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I mentioned in other replies . I got data format issue which was not measure . I was analysis my results both in power bi and pivot table . I found different result.&lt;/P&gt;&lt;P&gt;After I asked for help. I refresh database . The row with a nagetive value was remove and I got the same result.&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="177566" data-lia-user-login="speedramps" class="lia-mention lia-mention-user"&gt;speedramps&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="752610" data-lia-user-login="powerbidev123" class="lia-mention lia-mention-user"&gt;powerbidev123&lt;/a&gt;&amp;nbsp; Thanks alot again&amp;nbsp; All of&amp;nbsp; you people for contribution. and every suggestion&amp;nbsp; from you people is the solution to related problems.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:21:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413685#M175287</guid>
      <dc:creator>mohsin-raza</dc:creator>
      <dc:date>2025-02-17T11:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: sum function ignoring nagetive values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413707#M175289</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="303413" data-lia-user-login="mohsin-raza" class="lia-mention lia-mention-user"&gt;mohsin-raza&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears you may have overlooked some quantities for &lt;STRONG&gt;BD6-24E&lt;/STRONG&gt; in your calculations. Based on the screenshot data, the total quantity for &lt;STRONG&gt;BD6-24E&lt;/STRONG&gt; is &lt;STRONG&gt;65&lt;/STRONG&gt;, &lt;U&gt;not 30 or 29&lt;/U&gt;. This includes all instances of BD6-24E, even the negative quantity. Here is the screenshot of your data where I have highlighted the rows that you have missed in light blue color:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI also confirms this total of 65,i.e., it is also taking care of the negative values in the dataset. Here is the screenshot:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you clarify what might be causing the discrepancy?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please provide &lt;U&gt;sample data that &lt;STRONG&gt;fully&lt;/STRONG&gt; represents your issue or question in a &lt;STRONG&gt;usable format&lt;/STRONG&gt;&lt;/U&gt;, rather than a screenshot? Ensure the dataset is anonymized and does not contain any sensitive or unrelated information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, it would be very helpful if you could &lt;U&gt;share the &lt;STRONG&gt;expected outcome&lt;/STRONG&gt; based on the provided dat&lt;/U&gt;a - this can be in any format, including a screenshot. Having a clear reference for comparison will significantly improve the chances of getting the correct solution in the first response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For best practices, you may find the following links useful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener"&gt;Need help uploading data?&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank" rel="noopener"&gt;Want faster answers?&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Udit&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 11:30:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-function-ignoring-nagetive-values/m-p/4413707#M175289</guid>
      <dc:creator>quantumudit</dc:creator>
      <dc:date>2025-02-17T11:30:34Z</dc:date>
    </item>
  </channel>
</rss>

