<?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: Using Earlier() command for lag in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1123875#M16596</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="234029" data-lia-user-login="Anmol" class="lia-mention lia-mention-user"&gt;Anmol&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show a sample of the table you are using and explain with an example based on that data/table what you would need?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2020 16:21:02 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-05-27T16:21:02Z</dc:date>
    <item>
      <title>Using Earlier() command for lag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1123797#M16591</link>
      <description>&lt;P&gt;I am having a hard time to get a expected output on a calculated column, i know how to get it through sql though using window function(lag). Here is the sql command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;select&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;(select&amp;nbsp;lag(input_priority)&amp;nbsp;over&amp;nbsp;(partition&amp;nbsp;by&amp;nbsp;task_id&amp;nbsp;order&amp;nbsp;by&amp;nbsp;task_id,&amp;nbsp;request_datetime)&amp;nbsp;as&amp;nbsp;prv_input_priority&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,&amp;nbsp;input_priority&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,&amp;nbsp;convert(date,&amp;nbsp;request_datetime)&amp;nbsp;as&amp;nbsp;dateField&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from&amp;nbsp;task_log&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This will sort the data first on 'Task id' and then on&amp;nbsp;'request_datetime', after which will print the previous value of 'input_priority'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;On DAX i'm trying Earlier(), but having a very hard time to get the expected output.&lt;/SPAN&gt;&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>Wed, 27 May 2020 16:01:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1123797#M16591</guid>
      <dc:creator>Anmol</dc:creator>
      <dc:date>2020-05-27T16:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Earlier() command for lag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1123875#M16596</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="234029" data-lia-user-login="Anmol" class="lia-mention lia-mention-user"&gt;Anmol&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show a sample of the table you are using and explain with an example based on that data/table what you would need?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 16:21:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1123875#M16596</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-05-27T16:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using Earlier() command for lag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1124481#M16604</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;That's how the data looks like, im just looking for a calculated column that gives previous 'input_priority' only after sorting the data on 'task_id' and 'request_datetime'.&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 22:35:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1124481#M16604</guid>
      <dc:creator>Anmol</dc:creator>
      <dc:date>2020-05-27T22:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using Earlier() command for lag</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1125036#M16613</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="234029" data-lia-user-login="Anmol" class="lia-mention lia-mention-user"&gt;Anmol&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know&amp;nbsp; if this works for you.&lt;/P&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;STRONG&gt;Create Calculated Columns&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Previous_Value = CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX('Table'[Input_Priority]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER('Table','Table'[Task_Id] = EARLIER('Table'[Task_Id]) &amp;amp;&amp;amp; 'Table'[Request_DateTime] &amp;lt; EARLIER('Table'[Request_DateTime] )))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANK_ = RANKX(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER('Table',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Table'[Task_Id] = EARLIER('Table'[Task_Id])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Table'[Request_DateTime]&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;,,ASC,Dense)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 May 2020 05:36:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Earlier-command-for-lag/m-p/1125036#M16613</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-28T05:36:41Z</dc:date>
    </item>
  </channel>
</rss>

