<?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: Get count of active statuses from event log only if they are the most recent status per account in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860614#M185399</link>
    <description>&lt;P&gt;Active Accounts at Date =&lt;BR /&gt;VAR SelectedDate = MAX('DateTable'[Date])&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('StatusTable'),&lt;BR /&gt;'StatusTable'[Status Updated] &amp;lt;= SelectedDate&lt;BR /&gt;),&lt;BR /&gt;'StatusTable'[Account ID],&lt;BR /&gt;"LastStatus",&lt;BR /&gt;CALCULATE(&lt;BR /&gt;LASTNONBLANK('StatusTable'[Status], 1),&lt;BR /&gt;'StatusTable'[Status Updated] &amp;lt;= SelectedDate&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[LastStatus] = "Active"&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this answer helped, please click Kudos or mark as Solution.&lt;BR /&gt;-Kedar&lt;BR /&gt;LinkedIn: &lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank"&gt;https://www.linkedin.com/in/kedar-pande&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Oct 2025 12:59:50 GMT</pubDate>
    <dc:creator>Kedar_Pande</dc:creator>
    <dc:date>2025-10-28T12:59:50Z</dc:date>
    <item>
      <title>Get count of active statuses from event log only if they are the most recent status per account</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860048#M185384</link>
      <description>&lt;P&gt;I have a table of account status changes and I want to let the user set a date to see how many accounts had status "Active" at that date. I currently have a slicer that removes status updates after a certain date, but I need to write a DAX measure to get a count of the remaining "Active" statuses ONLY IF they are the most recent status for that account ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried many different ways to do this and I can't seem to get an accurate number. I can't do it in Power Query because it needs to be evaluated after the user changes the slicer, so it has to be done in a DAX measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some sample data from the table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Account ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Status&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Status Updated&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56147&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;TD&gt;10/7/2024 19:35&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56147&lt;/TD&gt;&lt;TD&gt;Install Scheduled&lt;/TD&gt;&lt;TD&gt;9/24/2024 19:16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56147&lt;/TD&gt;&lt;TD&gt;Pending Drop&lt;/TD&gt;&lt;TD&gt;9/19/2024 20:19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56147&lt;/TD&gt;&lt;TD&gt;Pending Drop&lt;/TD&gt;&lt;TD&gt;9/27/2024 20:53&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56147&lt;/TD&gt;&lt;TD&gt;Pending Install&lt;/TD&gt;&lt;TD&gt;10/3/2024 21:11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56147&lt;/TD&gt;&lt;TD&gt;Inactive&lt;/TD&gt;&lt;TD&gt;7/16/2025 17:44&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;58004&lt;/TD&gt;&lt;TD&gt;Pre-Drop CS Contact&lt;/TD&gt;&lt;TD&gt;9/10/2025 5:58&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;58004&lt;/TD&gt;&lt;TD&gt;Pending Drop&lt;/TD&gt;&lt;TD&gt;9/10/2025 20:39&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;58004&lt;/TD&gt;&lt;TD&gt;Drop Complete&lt;/TD&gt;&lt;TD&gt;9/19/2025 10:59&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;58004&lt;/TD&gt;&lt;TD&gt;Install Scheduled&lt;/TD&gt;&lt;TD&gt;9/19/2025 15:54&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;58004&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;TD&gt;9/23/2025 20:19&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 27 Oct 2025 22:47:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860048#M185384</guid>
      <dc:creator>anthonymachado</dc:creator>
      <dc:date>2025-10-27T22:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get count of active statuses from event log only if they are the most recent status per account</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860051#M185385</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1271166" data-lia-user-login="anthonymachado" class="lia-mention lia-mention-user"&gt;anthonymachado&lt;/a&gt;&amp;nbsp;could you give an example output based on some date selections?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2025 22:27:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860051#M185385</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2025-10-27T22:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get count of active statuses from event log only if they are the most recent status per account</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860057#M185386</link>
      <description>&lt;P&gt;If we're looking at the sample data, the output would be 1. Since the most recent status for Account ID 58004 is "Active" and the most recent status for Account 56147 is "Inactive" and I want to count the "Active" statuses if they are the most recent status for each account&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2025 22:46:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860057#M185386</guid>
      <dc:creator>anthonymachado</dc:creator>
      <dc:date>2025-10-27T22:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get count of active statuses from event log only if they are the most recent status per account</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860085#M185387</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 00:10:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860085#M185387</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2025-10-28T00:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get count of active statuses from event log only if they are the most recent status per account</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860289#M185392</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1271166" data-lia-user-login="anthonymachado" class="lia-mention lia-mention-user"&gt;anthonymachado&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step-by-Step Implementation:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1) Make sure your data is loaded properly, let’s call the table StatusLog in Power BI.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Ensure your date slicer is set up as&amp;nbsp;Show data "before" or "between".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Create the DAX Measure:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;Active Accounts (as of slicer) :=
VAR Accounts = VALUES ( 'StatusLog'[Account ID] )
RETURN
SUMX (
    Accounts,
    VAR Acc = 'StatusLog'[Account ID]
    VAR LastDt =
        CALCULATE (
            MAX ( 'StatusLog'[Status Updated] ),
            'StatusLog'[Account ID] = Acc
        )
    VAR LastStatus =
        CALCULATE (
            MAXX (
                FILTER (
                    'StatusLog',
                    'StatusLog'[Account ID] = Acc
                        &amp;amp;&amp;amp; 'StatusLog'[Status Updated] = LastDt
                ),
                'StatusLog'[Status]
            )
        )
    RETURN IF ( LastStatus = "Active", 1, 0 )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4) Add a Card visualization and&amp;nbsp;drag this new measure (Active Accounts (as of slicer) into it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Also attached&amp;nbsp;the pbix file.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/nasif-azam-9aa2331a0/" target="_blank" rel="noopener nofollow noreferrer"&gt;Nasif Azam&lt;/A&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 07:49:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860289#M185392</guid>
      <dc:creator>Nasif_Azam</dc:creator>
      <dc:date>2025-10-28T07:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get count of active statuses from event log only if they are the most recent status per account</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860614#M185399</link>
      <description>&lt;P&gt;Active Accounts at Date =&lt;BR /&gt;VAR SelectedDate = MAX('DateTable'[Date])&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('StatusTable'),&lt;BR /&gt;'StatusTable'[Status Updated] &amp;lt;= SelectedDate&lt;BR /&gt;),&lt;BR /&gt;'StatusTable'[Account ID],&lt;BR /&gt;"LastStatus",&lt;BR /&gt;CALCULATE(&lt;BR /&gt;LASTNONBLANK('StatusTable'[Status], 1),&lt;BR /&gt;'StatusTable'[Status Updated] &amp;lt;= SelectedDate&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[LastStatus] = "Active"&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this answer helped, please click Kudos or mark as Solution.&lt;BR /&gt;-Kedar&lt;BR /&gt;LinkedIn: &lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank"&gt;https://www.linkedin.com/in/kedar-pande&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 12:59:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860614#M185399</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2025-10-28T12:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get count of active statuses from event log only if they are the most recent status per account</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860729#M185409</link>
      <description>&lt;P&gt;This worked great! Mine had Status Updated underlined in red as well but it still worked&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 15:03:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-count-of-active-statuses-from-event-log-only-if-they-are-the/m-p/4860729#M185409</guid>
      <dc:creator>anthonymachado</dc:creator>
      <dc:date>2025-10-28T15:03:17Z</dc:date>
    </item>
  </channel>
</rss>

