<?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: Measure Total Incorrect When Filtering in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1915185#M41445</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="237299" data-lia-user-login="FrankieVee" class="lia-mention lia-mention-user"&gt;FrankieVee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm assuming TableA[Company], TableA[ItemID] are the fields determining the filter context in your visual above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Product Catalog Cost =
SUMX (
    SUMMARIZE( TableA, TableA[Company], TableA[ItemID] ),
    CALCULATE ( SUM ( TableA[currentcost] ) )
        * CALCULATE ( SUM ( TableB[agd_qty] ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 15:39:30 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2021-06-22T15:39:30Z</dc:date>
    <item>
      <title>Measure Total Incorrect When Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1906744#M41174</link>
      <description>&lt;P&gt;I have a measure that currently multiplies two columns, each from its own table. The output works as desired, but when filtering to a particular company (using a slicer visual) the Total at the bottom does not change. I've attempted a few solutions I found from similar posts here, as well as other sites, but still no luck.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the current table filtered to a single company (items vary). The Product Catalog Cost is my measure, as you can see from the incorrect total:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;My measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Product Catalog Cost = SUMX(TableA,TableA[currentcost]) * (SUMX(TableB,TableB[agd_qty]))&lt;/LI-CODE&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;Thank you, Frank V.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 13:54:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1906744#M41174</guid>
      <dc:creator>FrankieVee</dc:creator>
      <dc:date>2021-06-17T13:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Total Incorrect When Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1906923#M41178</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="237299" data-lia-user-login="FrankieVee" class="lia-mention lia-mention-user"&gt;FrankieVee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show sample of TableA and TableB (relevant columns) and what exactly the desired measure should be calculating: the multiplication of which two columns? The values you show in the rightmost column in the table are exactly the same as those in the Agreement _Cost column &lt;/P&gt;
&lt;P&gt;Are the two leftmost visible columns in the table visual measures? If so, show the code&lt;/P&gt;
&lt;P&gt;Are TableA and TableB related? How?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 15:21:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1906923#M41178</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2021-06-17T15:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Total Incorrect When Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1906946#M41179</link>
      <description>&lt;P&gt;I think it'll be hard to diagnose the issue without seeing the model.&lt;/P&gt;&lt;P&gt;One thing that does spring to mind is the summing of currentcost and agd_qty are happening separately in your measure, but it looks like currentcost can be zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the total level this probably isn't working.&amp;nbsp; Consider the row with agd_qty = 35.&amp;nbsp; That 35 will be part of the sum of agd_qty and will be multiplied by the total of currentcost.&amp;nbsp; Should the measure be multiplying agd_qty and currentcost per item first, then summing the result?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 15:31:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1906946#M41179</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-06-17T15:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Total Incorrect When Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1914959#M41429</link>
      <description>&lt;P&gt;Hello, sorry for the late response!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to multiple the "current cost" (found in TableA) by the quantity (found in TableB). The multiplication works as desired, my issue however is when filtering, the total at the bottom does not match. For example, in my OP's screenshot the total comes out to be 78,885.10, when it should be&amp;nbsp;&lt;SPAN&gt;1287.60.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The Agreement Cost is a column from the original table, and is not a measure. The only measure in my screenshot is the Product Catalog Cost.&lt;BR /&gt;&lt;BR /&gt;The tables have a relationship between the Item ID.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 13:57:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1914959#M41429</guid>
      <dc:creator>FrankieVee</dc:creator>
      <dc:date>2021-06-22T13:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Total Incorrect When Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1914978#M41431</link>
      <description>&lt;P&gt;This screenshot might be more relevant. I've taken out the Agreement Cost column (which isn't involved with my measure) and instead added the current cost column next to the quantity. Maybe this will help in understanding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This also shows that the totals are still multiplying. My measure's total is the multiplication of the AGD_Qty and CurrentCost columns (as is in my measure's formula).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 14:04:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1914978#M41431</guid>
      <dc:creator>FrankieVee</dc:creator>
      <dc:date>2021-06-22T14:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Total Incorrect When Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1915185#M41445</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="237299" data-lia-user-login="FrankieVee" class="lia-mention lia-mention-user"&gt;FrankieVee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm assuming TableA[Company], TableA[ItemID] are the fields determining the filter context in your visual above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Product Catalog Cost =
SUMX (
    SUMMARIZE( TableA, TableA[Company], TableA[ItemID] ),
    CALCULATE ( SUM ( TableA[currentcost] ) )
        * CALCULATE ( SUM ( TableB[agd_qty] ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 15:39:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1915185#M41445</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2021-06-22T15:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Total Incorrect When Filtering</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1915736#M41475</link>
      <description>&lt;P&gt;This did the trick! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 20:57:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Total-Incorrect-When-Filtering/m-p/1915736#M41475</guid>
      <dc:creator>FrankieVee</dc:creator>
      <dc:date>2021-06-22T20:57:09Z</dc:date>
    </item>
  </channel>
</rss>

