<?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: Help getting latest date for earlier value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3026317#M103206</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;First create a calculated column as follows&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Index2 =
LOA_Logs[Index per LOA]
    - RANKX (
        CALCULATETABLE (
            LOA_Logs,
            ALLEXCEPT ( LOA_Logs, LOA_Logs[LOA_UID], LOA_Logs[Responsibility] )
        ),
        LOA_Logs[Index per LOA],
        ,
        ASC,
        DENSE
    )&lt;/LI-CODE&gt;
&lt;P&gt;The the following can be either a measure or a calculated column&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Responsibility Set Date =
MINX (
    CALCULATETABLE (
        LOA_Logs,
        ALLEXCEPT ( LOA_Logs, LOA_Logs[LOA_UID], LOA_Logs[Index2] )
    ),
    LOA_Logs[CreateDate]
)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 17 Jan 2023 15:44:09 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-01-17T15:44:09Z</dc:date>
    <item>
      <title>Help getting latest date for earlier value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3014105#M102290</link>
      <description>&lt;P&gt;I have a table containing Dates when Responsibility gets set, see below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This &lt;EM&gt;Responsibility Set Date&lt;/EM&gt; produces very close to what I'm trying to achieve: I want to capture the &lt;EM&gt;CreateDate&lt;/EM&gt; any time the &lt;EM&gt;Responsibility&lt;/EM&gt; changes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But in cases where there are multiple records per responsibility, the &lt;EM&gt;_current&lt;/EM&gt; (MIN) variable reverts back to the initial &lt;EM&gt;CreateDate&lt;/EM&gt;. So, I get why it's producing the results it is, but am not sure how to get it to produce the desired results.&lt;/P&gt;&lt;P&gt;For the rows with red x's (Index rows 8 and 10), I need to see:&lt;/P&gt;&lt;P&gt;Index row 8 = 12/14/2022 3:39:28 PM (capturing the &lt;EM&gt;CreateDate&lt;/EM&gt; of row 7 at &lt;EM&gt;Responsibility&lt;/EM&gt; change)&lt;/P&gt;&lt;P&gt;Index row 10 = 12/20/2022 3:53:28 PM (capturing the &lt;EM&gt;CreateDate&lt;/EM&gt; of row 9 at &lt;EM&gt;Responsibility&lt;/EM&gt; change)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the dax currently generating the Responsibility Set Date results. I'm sure this is a simple fix, but it's been vexing for hours. Any help would be appreciated!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Responsibility Set Date = 
VAR previous =
CALCULATE(
    DISTINCT(LOA_Logs[Responsibility]),
    LOA_Logs[Index per LOA] = (EARLIER(LOA_Logs[Index per LOA]) - 1),
    ALLEXCEPT(LOA_Logs, LOA_Logs[LOA_UID], LOA_Logs[Responsibility])
)
VAR _current =
CALCULATE(MIN(LOA_Logs[CreateDate]),
FILTER(LOA_Logs,
LOA_Logs[LOA_UID] = EARLIER(LOA_Logs[LOA_UID]) &amp;amp;&amp;amp;
LOA_Logs[Responsibility] = EARLIER(LOA_Logs[Responsibility]))
)

RETURN
IF(LOA_Logs[Responsibility] &amp;lt;&amp;gt; previous, LOA_Logs[CreateDate], _current)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 14:38:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3014105#M102290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-11T14:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help getting latest date for earlier value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3014351#M102321</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Use Max in place of Min&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Responsibility Set Date = &lt;BR /&gt;VAR previous =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DISTINCT(LOA_Logs[Responsibility]),&lt;BR /&gt;filter(LOA_Logs, LOA_Logs[Index per LOA] = (EARLIER(LOA_Logs[Index per LOA]) - 1) &amp;amp;&amp;amp; &lt;BR /&gt;LOA_Logs[LOA_UID] = earlier(LOA_Logs[LOA_UID]) &amp;amp;&amp;amp; LOA_Logs[Responsibility] = earlier(LOA_Logs[Responsibility]) )&lt;BR /&gt;)&lt;BR /&gt;VAR _current =&lt;BR /&gt;CALCULATE(MAX(LOA_Logs[CreateDate]),&lt;BR /&gt;FILTER(LOA_Logs,&lt;BR /&gt;LOA_Logs[LOA_UID] = EARLIER(LOA_Logs[LOA_UID]) &amp;amp;&amp;amp;&lt;BR /&gt;LOA_Logs[Responsibility] = EARLIER(LOA_Logs[Responsibility]))&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;IF(LOA_Logs[Responsibility] &amp;lt;&amp;gt; previous, LOA_Logs[CreateDate], _current)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 15:54:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3014351#M102321</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-11T15:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help getting latest date for earlier value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3026073#M103195</link>
      <description>&lt;P&gt;Thanks for the assist&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;,&amp;nbsp;though unfortunately, this doesn't work. When I change MIN to MAX, I get a changing "Responsibility Set Date" even when the Responsibility field isn't changing. See below. In this screenshot, I'd expect rows 8-14 to all have Responsibility Set Date = 1/10/2023 3:59:38 PM.&lt;/P&gt;&lt;P&gt;Open to other suggestions - thanks again!&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 14:29:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3026073#M103195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-17T14:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help getting latest date for earlier value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3026317#M103206</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;First create a calculated column as follows&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Index2 =
LOA_Logs[Index per LOA]
    - RANKX (
        CALCULATETABLE (
            LOA_Logs,
            ALLEXCEPT ( LOA_Logs, LOA_Logs[LOA_UID], LOA_Logs[Responsibility] )
        ),
        LOA_Logs[Index per LOA],
        ,
        ASC,
        DENSE
    )&lt;/LI-CODE&gt;
&lt;P&gt;The the following can be either a measure or a calculated column&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Responsibility Set Date =
MINX (
    CALCULATETABLE (
        LOA_Logs,
        ALLEXCEPT ( LOA_Logs, LOA_Logs[LOA_UID], LOA_Logs[Index2] )
    ),
    LOA_Logs[CreateDate]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Jan 2023 15:44:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3026317#M103206</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-17T15:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help getting latest date for earlier value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3027038#M103256</link>
      <description>&lt;P&gt;That did it&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp; - thanks so much for the assist!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 21:51:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-getting-latest-date-for-earlier-value/m-p/3027038#M103256</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-17T21:51:36Z</dc:date>
    </item>
  </channel>
</rss>

