<?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 column based on distinct ID in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-column-based-on-distinct-ID/m-p/3351161#M125840</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can try this measure:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;meters per store = 
VAR t = SUMMARIZE ( 'Table', 'Table'[Store ID], 'Table'[Category], 'Table'[Length of Category (in meters)] )
RETURN
    SUMX ( t, [Length of Category (in meters)] )&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 26 Jul 2023 13:26:33 GMT</pubDate>
    <dc:creator>ERD</dc:creator>
    <dc:date>2023-07-26T13:26:33Z</dc:date>
    <item>
      <title>SUM column based on distinct ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-column-based-on-distinct-ID/m-p/3351071#M125835</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant seem to figure out the following (which looks very straightforward)&lt;BR /&gt;&lt;BR /&gt;I have a dataset which shows how much meter a category has in a store.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data set has rows for each article within a category, but the 'Length of Category' column is based on the total of that category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, in store 1, the Bread Category has 2,0 meter of space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Store ID&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Article&lt;/TD&gt;&lt;TD&gt;Length of Category (in meters)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Bread&lt;/TD&gt;&lt;TD&gt;White&lt;/TD&gt;&lt;TD&gt;2,0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Bread&lt;/TD&gt;&lt;TD&gt;Brown&lt;/TD&gt;&lt;TD&gt;2,0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Drinks&lt;/TD&gt;&lt;TD&gt;Water&lt;/TD&gt;&lt;TD&gt;4,0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Drinks&lt;/TD&gt;&lt;TD&gt;Soda&lt;/TD&gt;&lt;TD&gt;4,0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the example above, if I sum how much total meters store 1 has, it will add up to 12,0 (2+2+4+4), but I need it to be 6 (2+4). As I dont want the categories to double.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the correct way of doing this through dax? I cant seem to google it or figure it out and I feel like it's quite easy.&lt;/P&gt;&lt;P&gt;Help is much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 12:47:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-column-based-on-distinct-ID/m-p/3351071#M125835</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-26T12:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: SUM column based on distinct ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-column-based-on-distinct-ID/m-p/3351161#M125840</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can try this measure:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;meters per store = 
VAR t = SUMMARIZE ( 'Table', 'Table'[Store ID], 'Table'[Category], 'Table'[Length of Category (in meters)] )
RETURN
    SUMX ( t, [Length of Category (in meters)] )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Jul 2023 13:26:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-column-based-on-distinct-ID/m-p/3351161#M125840</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2023-07-26T13:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: SUM column based on distinct ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-column-based-on-distinct-ID/m-p/3351226#M125845</link>
      <description>&lt;P&gt;Worked like a charm!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the time and help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 13:50:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-column-based-on-distinct-ID/m-p/3351226#M125845</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-26T13:50:25Z</dc:date>
    </item>
  </channel>
</rss>

