<?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: Mulitple duplicates, need sum of total, not line by line. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934662#M9705</link>
    <description>&lt;P&gt;THANK YOU!! This is awesome! What a beautiful quick way to find get the solution!! Love this!&lt;/P&gt;&lt;P&gt;I didn't realize that you had to wrap the summarize function in a sumx, and that you could reference the summarize virtual table in this! How cool!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2020 00:10:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-17T00:10:40Z</dc:date>
    <item>
      <title>Mulitple duplicates, need sum of total, not line by line.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934307#M9672</link>
      <description>&lt;P&gt;&lt;SPAN class="style-scope yt-formatted-string"&gt;Hi, I need help!&lt;/SPAN&gt; &lt;SPAN class="style-scope yt-formatted-string"&gt;I'm trying to return the value for where there are costs, but no revenues. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="style-scope yt-formatted-string"&gt;But I have multiple duplicate sales orders. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="style-scope yt-formatted-string"&gt;So when I use a &lt;/SPAN&gt;&lt;SPAN class="style-scope yt-formatted-string"&gt;=calculate(sum(cost of sales), net revenues=0).&amp;nbsp; I get the result form sales order 1 below as well as sales order 2. I only want the results from sales order 2, where revenue in both instances is 0.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="style-scope yt-formatted-string"&gt;I don't want to aggregate (group) the data in power query because I need other line item details.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales Order ID&amp;nbsp; &amp;nbsp; Net Revenue&amp;nbsp; &amp;nbsp; &amp;nbsp;Total Costs&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Totals&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sales Order ID&lt;/TD&gt;&lt;TD&gt;Net Revenue&lt;/TD&gt;&lt;TD&gt;Total Costs&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 15 Feb 2020 21:08:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934307#M9672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-15T21:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Mulitple duplicates, need sum of total, not line by line.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934490#M9677</link>
      <description>&lt;P&gt;hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you can use something like this:&lt;/P&gt;&lt;PRE&gt;SalesOrderIDsWithoutRevenue = &lt;BR /&gt;var currentSalesOrder = min(data[SalesOrder])  &lt;BR /&gt;var rowsWithRevenue = CALCULATE (                   -- find all rows with revenue for SalesOrderId&lt;BR /&gt;COUNTROWS(data),&lt;BR /&gt;all(data),&lt;BR /&gt;data[SalesOrder] = currentSalesOrder, &lt;BR /&gt;data[Net Revenue] &amp;gt; 0&lt;BR /&gt;)&lt;BR /&gt;var x = CALCULATE(&lt;BR /&gt;sum(data[Total Costs]),&lt;BR /&gt;all(data),&lt;BR /&gt;'data'[SalesOrder] = currentSalesOrder &lt;BR /&gt;)&lt;BR /&gt;return &lt;BR /&gt;if (rowsWithRevenue=0,x)    -- Only show a value when there are no revenues against the SalesOrderID&lt;/PRE&gt;&lt;P&gt;This will not show a value for SalesOrderId 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2020 14:46:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934490#M9677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-16T14:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mulitple duplicates, need sum of total, not line by line.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934551#M9691</link>
      <description>&lt;P&gt;Hi Jan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking the time to answer me!! I think your solution is probably genius! If only I understood it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using PowerPivot in Excel. So I tried to translate your solution. I made three formulas as follows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current Sales Order&lt;/STRONG&gt;=min('Data'[Sales Order ID])&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rows with Revenue&lt;/STRONG&gt;=CALCULATE(countrows('Data'),all('Data'),'Data'[Sales Order ID]=[Current Sales Order])&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rev grouped by Sales Order&lt;/STRONG&gt;=if([Rows with Revenue]=0,CALCULATE([Total Costs],all('Data'),'Data'[Sales Order ID]=[Current Sales Order]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last two formulas have the following error:&amp;nbsp;A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.'.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2020 17:58:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934551#M9691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-16T17:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Mulitple duplicates, need sum of total, not line by line.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934567#M9695</link>
      <description>&lt;P&gt;Try something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CostWhereRevenue0 = SUMX(SUMMARIZE('Table', [Sales Order ID], "Cost", IF (SUM('Table'[Net Revenue]) = 0, SUM('Table'[Total Costs]))), [Cost])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It will group the data by Sales Order ID (that's what summarize does) and then check if net revenue is 0 for each row. If so it sums the cost.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 16 Feb 2020 18:55:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934567#M9695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-16T18:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Mulitple duplicates, need sum of total, not line by line.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934662#M9705</link>
      <description>&lt;P&gt;THANK YOU!! This is awesome! What a beautiful quick way to find get the solution!! Love this!&lt;/P&gt;&lt;P&gt;I didn't realize that you had to wrap the summarize function in a sumx, and that you could reference the summarize virtual table in this! How cool!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 00:10:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mulitple-duplicates-need-sum-of-total-not-line-by-line/m-p/934662#M9705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-17T00:10:40Z</dc:date>
    </item>
  </channel>
</rss>

