<?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: DAX for LAG in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2636324#M77288</link>
    <description>&lt;P&gt;Outstanding! Thank you very much&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; &amp;nbsp;I have been spinning my wheels for about a week now on this.&amp;nbsp; This will help with future lags in our data.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2022 12:39:01 GMT</pubDate>
    <dc:creator>ranis1227</dc:creator>
    <dc:date>2022-07-13T12:39:01Z</dc:date>
    <item>
      <title>DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634314#M77194</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if this redundant. Please link a previous solution if applicable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to running a LAG similar to SQL partitioned by category name and visit number, ordered by unit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example, the highlighed transfer unit is what I am looking for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The data is huge and SQL takes a while to load with it.&amp;nbsp; Thank you again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 16:52:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634314#M77194</guid>
      <dc:creator>ranis1227</dc:creator>
      <dc:date>2022-07-12T16:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634524#M77204</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335061" data-lia-user-login="ranis1227" class="lia-mention lia-mention-user"&gt;ranis1227&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Transfer Unit =
VAR CurrentVisitNumTable =
    CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[Visit_Number] ) )
VAR CurrentDateTime = TableName[Check_In_Time]
VAR TableAfter =
    FILTER ( CurrentVisitNumTable, TableName[Check_In_Time] &amp;gt; CurrentDateTime )
VAR NextRecordTable =
    TOPN ( 1, TableAfter, TableName[Check_In_Time], ASC )
VAR Result =
    MAXX ( NextRecordTable, TableName[Category_Name] )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Jul 2022 19:03:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634524#M77204</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-12T19:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634535#M77205</link>
      <description>&lt;P&gt;This is exactly what I am looking for.&amp;nbsp; Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 19:12:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634535#M77205</guid>
      <dc:creator>ranis1227</dc:creator>
      <dc:date>2022-07-12T19:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634542#M77206</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335061" data-lia-user-login="ranis1227" class="lia-mention lia-mention-user"&gt;ranis1227&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;How many rows do you have in this table?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 19:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634542#M77206</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-12T19:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634547#M77207</link>
      <description>&lt;P&gt;Over a 1000.&amp;nbsp; However, I am filtering some out in power query.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 19:18:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634547#M77207</guid>
      <dc:creator>ranis1227</dc:creator>
      <dc:date>2022-07-12T19:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634552#M77208</link>
      <description>&lt;P&gt;When you said huge I though milions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I was worried about the performance&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 19:21:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634552#M77208</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-12T19:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634623#M77211</link>
      <description>&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Sorry about this. I misinterpreted the issue.&amp;nbsp; The actual data should look 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;To Unit&lt;/TD&gt;&lt;TD&gt;visit_number&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;check_in_time&lt;/TD&gt;&lt;TD&gt;From Unit&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9A&lt;/TD&gt;&lt;TD&gt;5016226269&lt;/TD&gt;&lt;TD&gt;6/24/2022 2:37&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12BI&lt;/TD&gt;&lt;TD&gt;5016226269&lt;/TD&gt;&lt;TD&gt;7/7/2022 4:40&lt;/TD&gt;&lt;TD&gt;9A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12BI&lt;/TD&gt;&lt;TD&gt;5016226269&lt;/TD&gt;&lt;TD&gt;7/7/2022 22:55&lt;/TD&gt;&lt;TD&gt;12BI&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5JIN&lt;/TD&gt;&lt;TD&gt;5016226269&lt;/TD&gt;&lt;TD&gt;7/8/2022 15:24&lt;/TD&gt;&lt;TD&gt;12BI&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12BI&lt;/TD&gt;&lt;TD&gt;5016226269&lt;/TD&gt;&lt;TD&gt;7/8/2022 15:32&lt;/TD&gt;&lt;TD&gt;5JIN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5JIN&lt;/TD&gt;&lt;TD&gt;5016226269&lt;/TD&gt;&lt;TD&gt;7/8/2022 17:07&lt;/TD&gt;&lt;TD&gt;12BI&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12BI&lt;/TD&gt;&lt;TD&gt;5016226269&lt;/TD&gt;&lt;TD&gt;7/9/2022 18:48&lt;/TD&gt;&lt;TD&gt;5JIN&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I updated your dax on various iterations and could not get it.&amp;nbsp; &amp;nbsp;Let me know if you have any ideas. Thank you again for the input. Sorry for the confusion.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 20:25:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634623#M77211</guid>
      <dc:creator>ranis1227</dc:creator>
      <dc:date>2022-07-12T20:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634683#M77214</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335061" data-lia-user-login="ranis1227" class="lia-mention lia-mention-user"&gt;ranis1227&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;From Unit is the column to be calculated?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 21:28:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634683#M77214</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-12T21:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634727#M77217</link>
      <description>&lt;P&gt;Correct.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 22:09:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2634727#M77217</guid>
      <dc:creator>ranis1227</dc:creator>
      <dc:date>2022-07-12T22:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2635409#M77244</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335061" data-lia-user-login="ranis1227" class="lia-mention lia-mention-user"&gt;ranis1227&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Here is a sample file with the solution&amp;nbsp;&lt;A href="https://we.tl/t-5GlKHJIedF" target="_blank"&gt;https://we.tl/t-5GlKHJIedF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;From Unit = 
VAR CurrentVisitNumTable =
    CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[visit_number ] ) )
VAR CurrentDateTime = TableName[Check_In_Time]
VAR TableBefore =
    FILTER ( CurrentVisitNumTable, TableName[Check_In_Time] &amp;lt; CurrentDateTime )
VAR PreviousRecordTable =
    TOPN ( 1, TableBefore, TableName[Check_In_Time] )
VAR Result =
    MAXX ( PreviousRecordTable, TableName[To Unit] )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Jul 2022 06:52:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2635409#M77244</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-13T06:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for LAG</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2636324#M77288</link>
      <description>&lt;P&gt;Outstanding! Thank you very much&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; &amp;nbsp;I have been spinning my wheels for about a week now on this.&amp;nbsp; This will help with future lags in our data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 12:39:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-LAG/m-p/2636324#M77288</guid>
      <dc:creator>ranis1227</dc:creator>
      <dc:date>2022-07-13T12:39:01Z</dc:date>
    </item>
  </channel>
</rss>

