<?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 SumX not working properly - filter problem? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SumX-not-working-properly-filter-problem/m-p/3778034#M147666</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate my total netweight sold as a measure (not calculated column)&lt;/P&gt;&lt;P&gt;So I just want to multiply the qty sold with the netweight from my itemtable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see from the 2 matrix below the 2 measures "Netweight from Item" and "SUMX(ALLSelected-wrong" works fine in the first matrix where only items are included. However when customers are added in the 2 matrix you see the problem "Netweight from Item" is blank for 1 customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see from the measure "Netweight from Item" I also tried removing filters from vDIM_customer table. But that cannot work as I then get a memory error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I hope you have another solution ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Netweight from Item:&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;average(vDIM_Items[NetWeight])&lt;BR /&gt;, REMOVEFILTERS(DIM_Time)&lt;BR /&gt;// , REMOVEFILTERS(vDIM_Customer)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;SUMX(ALLSelected-wrong:&lt;/P&gt;&lt;P&gt;sumx(allselected(vDIM_Items[ItemID]),CALCULATE([QTY]*[Netweight from Item]))&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2024 09:50:41 GMT</pubDate>
    <dc:creator>Dennis_Pedersen</dc:creator>
    <dc:date>2024-03-20T09:50:41Z</dc:date>
    <item>
      <title>SumX not working properly - filter problem?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SumX-not-working-properly-filter-problem/m-p/3778034#M147666</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate my total netweight sold as a measure (not calculated column)&lt;/P&gt;&lt;P&gt;So I just want to multiply the qty sold with the netweight from my itemtable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see from the 2 matrix below the 2 measures "Netweight from Item" and "SUMX(ALLSelected-wrong" works fine in the first matrix where only items are included. However when customers are added in the 2 matrix you see the problem "Netweight from Item" is blank for 1 customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see from the measure "Netweight from Item" I also tried removing filters from vDIM_customer table. But that cannot work as I then get a memory error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I hope you have another solution ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Netweight from Item:&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;average(vDIM_Items[NetWeight])&lt;BR /&gt;, REMOVEFILTERS(DIM_Time)&lt;BR /&gt;// , REMOVEFILTERS(vDIM_Customer)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;SUMX(ALLSelected-wrong:&lt;/P&gt;&lt;P&gt;sumx(allselected(vDIM_Items[ItemID]),CALCULATE([QTY]*[Netweight from Item]))&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 09:50:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SumX-not-working-properly-filter-problem/m-p/3778034#M147666</guid>
      <dc:creator>Dennis_Pedersen</dc:creator>
      <dc:date>2024-03-20T09:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: SumX not working properly - filter problem?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SumX-not-working-properly-filter-problem/m-p/3782028#M147750</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="150977" data-lia-user-login="Dennis_Pedersen" class="lia-mention lia-mention-user"&gt;Dennis_Pedersen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try to modify the formula as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Netweight from Item:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE(
average(vDIM_Items[NetWeight])
, ALLSELECTED("Your table name", Yourcolumnname)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SUMX(ALLSelected-wrong:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sumx(allselected(vDIM_Items[ItemID]),[QTY]*[Netweight from Item])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the problem persists,&amp;nbsp;please provide detailed sample data:&amp;nbsp;&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"&gt;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt; .&amp;nbsp;Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 08:28:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SumX-not-working-properly-filter-problem/m-p/3782028#M147750</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-21T08:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: SumX not working properly - filter problem?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SumX-not-working-properly-filter-problem/m-p/3782538#M147763</link>
      <description>&lt;P&gt;Thanks but unfortunatetely it looks the same.&lt;/P&gt;&lt;P&gt;You mean formulas like below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Netweight from Item:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;average(vDIM_Items[NetWeight])&lt;BR /&gt;, ALLSELECTED(vDIM_Items[ItemID])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SUMX(ALLSelected-wrong:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sumx(allselected(vDIM_Items[ItemID]),[QTY]*[Netweight from Item])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 11:20:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SumX-not-working-properly-filter-problem/m-p/3782538#M147763</guid>
      <dc:creator>Dennis_Pedersen</dc:creator>
      <dc:date>2024-03-21T11:20:35Z</dc:date>
    </item>
  </channel>
</rss>

