<?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 of distinct values in a group in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/1476042#M28098</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try a measure like &lt;/P&gt;
&lt;P&gt;sumx(Values(Table[item]) , calculate(max(Table[Cost])))&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2020 08:04:48 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-11-05T08:04:48Z</dc:date>
    <item>
      <title>SUM of distinct values in a group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/1475955#M28089</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am fairly new to DAX so i am sure it would have been a common case but i am not able to find a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Sample data&amp;nbsp; for the problem :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have three columns and i want the sum to based on distinct values in item and cost group.&lt;/P&gt;&lt;P&gt;For example in the above dataset i need cost 1,000 only once since it is for the same item but 2,000 to be counted twice as it is for different items while calculating sum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the following formula: CALCULATE(SUM(ITEM), GROUPBY( TABLE_NAME, ITEM, COST))&lt;/P&gt;&lt;P&gt;But this gives me sum of cost as 7,000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks in Advance!!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 07:17:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/1475955#M28089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-05T07:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of distinct values in a group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/1476021#M28094</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can try your measure this way, hope you have a similar number for each item.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total = 
SUMX(
    SUMMARIZE( table5, Table5[ITEM], "A", MAX(Table5[COST])),
    [A]
)&lt;/LI-CODE&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help the other members find it&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 07:57:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/1476021#M28094</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-11-05T07:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of distinct values in a group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/1476042#M28098</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try a measure like &lt;/P&gt;
&lt;P&gt;sumx(Values(Table[item]) , calculate(max(Table[Cost])))&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 08:04:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/1476042#M28098</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-05T08:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of distinct values in a group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/2709661#M82263</link>
      <description>&lt;P&gt;This measure works, thanks for the awesome solution.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 11:14:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/2709661#M82263</guid>
      <dc:creator>Raj_sharma123</dc:creator>
      <dc:date>2022-08-18T11:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of distinct values in a group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/2737822#M84002</link>
      <description>&lt;P&gt;I was also facing same problem, and it worked for me,&amp;nbsp;&lt;BR /&gt;Thankyou so much.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 10:51:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/2737822#M84002</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-31T10:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of distinct values in a group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/2958352#M98376</link>
      <description>&lt;P&gt;Thank you for sharing the measure you tried to use! This helped me with mine, as my data model looks like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Account ID&lt;/TD&gt;&lt;TD&gt;Product ID&lt;/TD&gt;&lt;TD&gt;Transaction Date&lt;/TD&gt;&lt;TD&gt;CountedRowsFromAnotherTable&lt;BR /&gt;(linked by Product ID)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;Prod1&lt;/TD&gt;&lt;TD&gt;1/1/2020&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;Prod2&lt;/TD&gt;&lt;TD&gt;1/5/2020&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DEF&lt;/TD&gt;&lt;TD&gt;Prod3&lt;/TD&gt;&lt;TD&gt;2/2/2020&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I wanted to get is a total of 150 for account, "ABC" for the year 2020, and it worked!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 07:16:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/2958352#M98376</guid>
      <dc:creator>kymramosrpo</dc:creator>
      <dc:date>2022-12-09T07:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: SUM of distinct values in a group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/3073823#M106794</link>
      <description>&lt;P&gt;This is exactly what i needed today, I cant believe it was so simple. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 07:28:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-of-distinct-values-in-a-group/m-p/3073823#M106794</guid>
      <dc:creator>sandeep_mehra</dc:creator>
      <dc:date>2023-02-10T07:28:33Z</dc:date>
    </item>
  </channel>
</rss>

