<?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 distinct values for each id for latest date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4860669#M185405</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;SubID&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;02/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;02/01/2025&lt;/TD&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;01/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;02/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ID 1, on latest date I have two records with same value, so I need to pick only 20. Output should be below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;ID&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Tue, 28 Oct 2025 14:01:03 GMT</pubDate>
    <dc:creator>rob_vander2</dc:creator>
    <dc:date>2025-10-28T14:01:03Z</dc:date>
    <item>
      <title>sum distinct values for each id for latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4860669#M185405</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have below dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;SubID&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;02/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;02/01/2025&lt;/TD&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;01/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;02/01/2025&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ID 1, on latest date I have two records with same value, so I need to pick only 20. Output should be below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;ID&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 28 Oct 2025 14:01:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4860669#M185405</guid>
      <dc:creator>rob_vander2</dc:creator>
      <dc:date>2025-10-28T14:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values for each id for latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4860978#M185419</link>
      <description>&lt;P&gt;Do you want this in DAX or in Power Query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 19:29:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4860978#M185419</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-10-28T19:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values for each id for latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4861018#M185420</link>
      <description>&lt;P&gt;Hey Rob&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If i had such dataset then i would first split the column of date into 2 where once column we will have the date and 2nd the alphabet which is at the end and then creat the matrix where my row would be ID and make the mesure for the Value where i would calculate it it using dax function like calculate/TOPN/etc there are mutiple ways plese let me know if you want the dax.&lt;BR /&gt;&lt;BR /&gt;And in case you want to make the table clean in power query then i have attached the image for your reference ther can be other way to solve it but this is the one i got output with&amp;nbsp;&lt;BR /&gt;Advance editor -&lt;BR /&gt;let&lt;BR /&gt;Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIw1AciIwMj00Qgz9DAQClWBypjhCxjhE0iCSFhhNMsIwyzTIESsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Date = _t, SubIDValue = _t]),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Date", type text}, {"SubIDValue", Int64.Type}}),&lt;BR /&gt;#"Split Column by Position" = Table.SplitColumn(#"Changed Type", "Date", Splitter.SplitTextByRepeatedLengths(10), {"Date.1", "Date.2"}),&lt;BR /&gt;#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Position",{{"Date.1", type date}, {"Date.2", type text}}),&lt;BR /&gt;#"Grouped Rows" = Table.Group(#"Changed Type1", {"ID"}, {{"max of date", each List.Max([Date.1]), type nullable date}, {"Min of alphabet", each List.Min([Date.2]), type nullable text}, {"Value", each _, type table [ID=nullable number, Date.1=nullable date, Date.2=nullable text, SubIDValue=nullable number]}}),&lt;BR /&gt;#"Expanded Value" = Table.ExpandTableColumn(#"Grouped Rows", "Value", {"Date.1", "Date.2", "SubIDValue"}, {"Value.Date.1", "Value.Date.2", "Value.SubIDValue"}),&lt;BR /&gt;#"Added Custom" = Table.AddColumn(#"Expanded Value", "flag", each if [max of date]=[Value.Date.1] and [Min of alphabet]=[Value.Date.2] then "Yes" else "No"),&lt;BR /&gt;#"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([flag] = "Yes")),&lt;BR /&gt;#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Value.Date.1", "Value.Date.2", "flag"})&lt;BR /&gt;in&lt;BR /&gt;#"Removed Columns"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If need any clarification please feel free to reachout to me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 20:22:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4861018#M185420</guid>
      <dc:creator>TanishJain</dc:creator>
      <dc:date>2025-10-28T20:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values for each id for latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4861040#M185424</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="628059" data-lia-user-login="rob_vander2" class="lia-mention lia-mention-user"&gt;rob_vander2&lt;/a&gt;&amp;nbsp;try this measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum Latest = 
CALCULATE ( 
    SUM ( 'Table Latest'[Value] ),
    INDEX ( 
        -1,
        ALLSELECTED ( 'Table Latest'[ID], 'Table Latest'[SubID], 'Table Latest'[Date], 'Table Latest'[Value] ),
        ORDERBY ( 'Table Latest'[Date] ),
        PARTITIONBY ( 'Table Latest'[ID] )
    )
)&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 20:57:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4861040#M185424</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2025-10-28T20:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values for each id for latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4861796#M185446</link>
      <description>&lt;P&gt;I want in DAX&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 15:53:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4861796#M185446</guid>
      <dc:creator>rob_vander2</dc:creator>
      <dc:date>2025-10-29T15:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values for each id for latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4862011#M185453</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="628059" data-lia-user-login="rob_vander2" class="lia-mention lia-mention-user"&gt;rob_vander2&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thanks for reaching out to the Microsoft fabric community forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also take a moment to thank &amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp; , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.&amp;nbsp;&lt;BR /&gt;I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Community Support Team&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 03:08:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4862011#M185453</guid>
      <dc:creator>v-menakakota</dc:creator>
      <dc:date>2025-10-30T03:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: sum distinct values for each id for latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4864840#M185532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="628059" data-lia-user-login="rob_vander2" class="lia-mention lia-mention-user"&gt;rob_vander2&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Community Support Team&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 10:12:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/sum-distinct-values-for-each-id-for-latest-date/m-p/4864840#M185532</guid>
      <dc:creator>v-menakakota</dc:creator>
      <dc:date>2025-11-03T10:12:08Z</dc:date>
    </item>
  </channel>
</rss>

