<?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: Filtering a table to show unique ID, latest date per unique ID and then sum up those related values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/2519346#M70151</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389676" data-lia-user-login="Stoned_Edge10" class="lia-mention lia-mention-user"&gt;Stoned_Edge10&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please refer to my pbix file to see if it helps you.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _maxdate =
    CALCULATE (
        MAX ( 'Table'[LastDate (Per Client)] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Client ID] = SELECTEDVALUE ( 'Table'[Client ID] )
        )
    )
RETURN
    IF ( MAX ( 'Table'[LastDate (Per Client)] ) = _maxdate, 1, BLANK () )
&lt;/LI-CODE&gt;
&lt;P&gt;Then filter the measure.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If I have misunderstood your meaning, pleas provide more details with your desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution 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>Tue, 17 May 2022 05:38:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-17T05:38:56Z</dc:date>
    <item>
      <title>Filtering a table to show unique ID, latest date per unique ID and then sum up those related values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/2514026#M69815</link>
      <description>&lt;P&gt;Hi there all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm recently returning to Power BI after a 2 year hiatus and I've forgotten a lot of basic things, like row and filter context, how calculate works... funny how all this happens, hopefully it comes back to me soon.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to achieve is basically a KPI "card" that shows the number of customers my company currently has.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current table looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Client ID&lt;/TD&gt;&lt;TD&gt;LastDate (Per Client)&lt;/TD&gt;&lt;TD&gt;VenueNumber&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;09/01/2022&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;09/09/2022&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;09/01/2022&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;08/01/2022&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;09/01/2022&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is the output I would like to achieve, using a DAX measure (eventually summing the total venue numbers), with the below table being fiterable with my date table (i.e by year, by month, etc) - its essentially a running total of venues.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Client ID&lt;/TD&gt;&lt;TD&gt;LastDate (Per Client)&lt;/TD&gt;&lt;TD&gt;VenueNumber&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;10/01/2022&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone could help me achieve this with a DAX measure it would be much appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking forward to hopping back into the Power BI scene (last I used this was 2018 during an internship!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;StonedEdge&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 16:00:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/2514026#M69815</guid>
      <dc:creator>Stoned_Edge10</dc:creator>
      <dc:date>2022-05-13T16:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a table to show unique ID, latest date per unique ID and then sum up those related values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/2514064#M69822</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389676" data-lia-user-login="Stoned_Edge10" class="lia-mention lia-mention-user"&gt;Stoned_Edge10&lt;/a&gt;&amp;nbsp; create these measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last Date (Per Client) Measure = MAX(Clients[Date])

Venue Number Measure = 
SUMX(
    VALUES(Clients[Client ID]),
    VAR _current_client = Clients[Client ID]
    VAR _max_date = [Last Date (Per Client)]
    VAR _venue = 
        MAXX(
            FILTER(
                Clients,
                Clients[Client ID] = _current_client &amp;amp;&amp;amp; Clients[Date] = _max_date
            ),
            Clients[VenueNumber]
        )
    RETURN
        _venue
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Contoso-by-SpartaBI/m-p/2449543" target="_blank" rel="noopener"&gt;Showcase Report – Contoso By SpartaBI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.linkedin.com/company/spartabi" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/SpartaBI" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 16:27:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/2514064#M69822</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-13T16:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a table to show unique ID, latest date per unique ID and then sum up those related values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/2519346#M70151</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="389676" data-lia-user-login="Stoned_Edge10" class="lia-mention lia-mention-user"&gt;Stoned_Edge10&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please refer to my pbix file to see if it helps you.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _maxdate =
    CALCULATE (
        MAX ( 'Table'[LastDate (Per Client)] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Client ID] = SELECTEDVALUE ( 'Table'[Client ID] )
        )
    )
RETURN
    IF ( MAX ( 'Table'[LastDate (Per Client)] ) = _maxdate, 1, BLANK () )
&lt;/LI-CODE&gt;
&lt;P&gt;Then filter the measure.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If I have misunderstood your meaning, pleas provide more details with your desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution 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>Tue, 17 May 2022 05:38:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/2519346#M70151</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-17T05:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering a table to show unique ID, latest date per unique ID and then sum up those related values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/3466064#M132272</link>
      <description>&lt;P&gt;Why this approach doesnt work if you have matrix visual?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 03:15:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-a-table-to-show-unique-ID-latest-date-per-unique-ID/m-p/3466064#M132272</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-09T03:15:21Z</dc:date>
    </item>
  </channel>
</rss>

