<?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 Sum the Unique values to appropriate value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389525#M174255</link>
    <description>&lt;PRE&gt;&lt;SPAN class=""&gt;Can anybody help me with this:
Sum the unique values ​​in column "B" to the appropriate value in column "A".&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2025 08:52:14 GMT</pubDate>
    <dc:creator>Kopec</dc:creator>
    <dc:date>2025-01-31T08:52:14Z</dc:date>
    <item>
      <title>Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389525#M174255</link>
      <description>&lt;PRE&gt;&lt;SPAN class=""&gt;Can anybody help me with this:
Sum the unique values ​​in column "B" to the appropriate value in column "A".&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 08:52:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389525#M174255</guid>
      <dc:creator>Kopec</dc:creator>
      <dc:date>2025-01-31T08:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389578#M174256</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296896" data-lia-user-login="Kopec" class="lia-mention lia-mention-user"&gt;Kopec&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can achieve this in Power BI using DAX with a measure that sums the unique values of Column B for each corresponding value in Column A. The following DAX measure accomplishes this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result =
SUMX (
    VALUES ( 'Table'[Column B] ),
    'Table'[Column B]
)
&lt;/LI-CODE&gt;
&lt;P&gt;This measure works by extracting the unique values in Column B for each group in Column A using VALUES('Table'[Column B]), then iterating over these unique values and summing them with SUMX(...). If you prefer to do this transformation in Power Query, you would first remove duplicates from Column B while keeping only unique values for each group in Column A. Then, you would group by Column A and sum the unique values in Column B. Finally, merge this result back to the original table to display the calculated sum in a new column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&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>Fri, 31 Jan 2025 09:19:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389578#M174256</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2025-01-31T09:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389813#M174266</link>
      <description>&lt;P&gt;It's almost done, but I need:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMX (
    VALUES ( 'Table'[Column B] ),
    'Table'[Column A]
)&lt;/LI-CODE&gt;&lt;P&gt;In Column "A" is string.... I have got a mistake. I suppose because of that STRING values in Column A.&lt;BR /&gt;Can you help me?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 11:54:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389813#M174266</guid>
      <dc:creator>Kopec</dc:creator>
      <dc:date>2025-01-31T11:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389909#M174269</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296896" data-lia-user-login="Kopec" class="lia-mention lia-mention-user"&gt;Kopec&lt;/a&gt;&amp;nbsp;- You can use the below to get your desired answer (just change the column names):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR _table = SUMMARIZE( 'Table', 'Table'[Column1],  'Table'[Column2] )

RETURN
SUMX( _table, 'Table'[Column2])&lt;/LI-CODE&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this works for you please accept as the solution to help others with the same challenge.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 12:55:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389909#M174269</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2025-01-31T12:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389942#M174270</link>
      <description>&lt;P&gt;Hi Mark,&lt;BR /&gt;ist look great, but I need to get value for every row in the table. According to the picture (column "RESULT"):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 13:08:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4389942#M174270</guid>
      <dc:creator>Kopec</dc:creator>
      <dc:date>2025-01-31T13:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4390198#M174283</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296896" data-lia-user-login="Kopec" class="lia-mention lia-mention-user"&gt;Kopec&lt;/a&gt;&amp;nbsp;- As far as I'm aware this will be nearly impossible in a measure due to the way Power BI groups identical rows in it's visualisations. Even if you add an index column to undo the grouping, there will still be an issue with the way we have to use SUMMARIZE to remove the row duplication to get the result you want.&lt;BR /&gt;&lt;BR /&gt;There may be a solution out there for you but I've tried a few, including adding a duplicate of the table, and none seem to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you think about why it is necessary to present your data in this way, and if the solution I have provided works, or use Excel.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 10:12:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4390198#M174283</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2025-02-03T10:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4391752#M174347</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for the solution&amp;nbsp;mark_endicott&amp;nbsp; and&amp;nbsp;DataNinja777&amp;nbsp; offered, and i want to offer some more information for user to refer to.&lt;/P&gt;
&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296896" data-lia-user-login="Kopec" class="lia-mention lia-mention-user"&gt;Kopec&lt;/a&gt;&amp;nbsp;,&amp;nbsp;mark_endicott&amp;nbsp;'s solution is right, you can use it as a calculated column .&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR a =
    SUMMARIZE ( 'Table', [Column1], [Column2] )
RETURN
    SUMX ( FILTER ( a, [Column1] = EARLIER ( 'Table'[Column1] ) ), [Column2] )
&lt;/LI-CODE&gt;
&lt;P&gt;Output&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Yolo Zhu&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&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>Mon, 03 Feb 2025 05:45:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4391752#M174347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-03T05:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4392262#M174362</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;- Thank you, I always forget about calculated columns! Can I request we mark my solution please as this one is solved!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 10:28:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4392262#M174362</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2025-02-03T10:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4393088#M174394</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;for Power BI it works great.&lt;/P&gt;&lt;P&gt;Can anybody help me how to make it work in Power Pivot?&lt;BR /&gt;And can anybody know, why the below formula doesnt work?&lt;BR /&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P&gt;=CALCULATE (SUMX(&lt;STRONG&gt;TABLE&lt;/STRONG&gt;&lt;EM&gt;;&lt;/EM&gt; &lt;STRONG&gt;Column B&lt;/STRONG&gt;);VALUES(&lt;STRONG&gt;Column B&lt;/STRONG&gt;); ALLEXCEPT(&lt;STRONG&gt;TABLE&lt;/STRONG&gt;; &lt;STRONG&gt;Column A&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 20:47:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4393088#M174394</guid>
      <dc:creator>Kopec</dc:creator>
      <dc:date>2025-02-03T20:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sum the Unique values to appropriate value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4393935#M174435</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296896" data-lia-user-login="Kopec" class="lia-mention lia-mention-user"&gt;Kopec&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The formula i offered can work in power pivot.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Yolo Zhu&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 09:09:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-the-Unique-values-to-appropriate-value/m-p/4393935#M174435</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-04T09:09:52Z</dc:date>
    </item>
  </channel>
</rss>

