<?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: Power Query Recursion: Simple reference of same row in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4591563#M147331</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="922807" data-lia-user-login="TuqueLogic" class="lia-mention lia-mention-user"&gt;TuqueLogic&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;SPAN data-teams="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 02 Mar 2025 06:12:54 GMT</pubDate>
    <dc:creator>v-saisrao-msft</dc:creator>
    <dc:date>2025-03-02T06:12:54Z</dc:date>
    <item>
      <title>Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418333#M146635</link>
      <description>&lt;P&gt;Just looking to do a simple recursive reference but Power Query doesn't seem to be simple with recursion.&lt;BR /&gt;&lt;BR /&gt;Table with 3 columns:&amp;nbsp;&lt;BR /&gt;Index,&amp;nbsp; Date,&amp;nbsp; AdjustedDate&lt;BR /&gt;&lt;BR /&gt;Date is a datetime var, imported data&lt;BR /&gt;Index is an ascending index assign at import&lt;BR /&gt;AdjustedDate is for the recursion function&lt;BR /&gt;&lt;BR /&gt;This is the logic to employ:&lt;BR /&gt;AdjustedDate =&amp;nbsp;&lt;BR /&gt;If Table[Date] at index &amp;gt; Table[AdjustedDate] at index-1&lt;BR /&gt;then&amp;nbsp;Table[Date] at index&amp;nbsp;&lt;BR /&gt;else&amp;nbsp;Table[AdjustedDate]&amp;nbsp;at index-1&lt;BR /&gt;&lt;BR /&gt;Can't just add an offset row for Date as the Date row used can be an undetermined number of rows up.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 20:48:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418333#M146635</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-19T20:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418342#M146638</link>
      <description>&lt;P&gt;PQ definitely support recursive functions. Your example does not contain any function though, so I do not understand your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI a recursive function: (the&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409401" data-lia-user-login="sign" class="lia-mention lia-mention-user"&gt;sign&lt;/a&gt; before the call of the function #"!" tells PQ it is a recursive call)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Did I answer your question? Then please (also) mark my post as a solution and make it easier to find for others having a similar problem. &lt;BR /&gt;Remember: You can mark multiple answers as a solution...&lt;BR /&gt;If I helped you, please click on the Thumbs Up to give Kudos.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" color="#008000"&gt;&lt;STRONG&gt;Kees Stolker&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;A big fan of Power Query and Excel&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 21:00:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418342#M146638</guid>
      <dc:creator>PwerQueryKees</dc:creator>
      <dc:date>2025-02-19T21:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418357#M146639</link>
      <description>&lt;P&gt;This is the logic of the function:&lt;BR /&gt;AdjustedDate =&amp;nbsp;&lt;BR /&gt;If Table[Date] at index &amp;gt; Table[AdjustedDate] at index-1&lt;BR /&gt;then&amp;nbsp;Table[Date] at index&amp;nbsp;&lt;BR /&gt;else&amp;nbsp;Table[AdjustedDate]&amp;nbsp;at index-1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Or in another fashion:&lt;BR /&gt;x = Table[Date] at index&lt;BR /&gt;y = Table[AdjustedDate] at index-1&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if x&amp;gt;y then x else y&lt;BR /&gt;&lt;BR /&gt;If it were 2 columns A, B in excel it would be (starting at B2)&lt;BR /&gt;B2 = IF( B2&amp;gt;A1, B2, A1)&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 21:17:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418357#M146639</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-19T21:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418372#M146641</link>
      <description>&lt;P&gt;Ah! But in excel, every expression is evaluated on the level of a cell. In PowerQuery the expression is evaluated for the whole column (or table or whatever you pass it) at once.&lt;/P&gt;
&lt;P&gt;In other words, Excel Formulas and M expressions work completely different.&lt;/P&gt;
&lt;P&gt;And "at index" is not part of the syntax. You can refer to a row as {Index} but there is no concept of previous row in M.&lt;/P&gt;
&lt;P&gt;My advice: Try to learn PowerQuery M language if you need heavy data crunching in excel, but never assume it to be similar to excel formula language in any way, even if there seem to be similarities.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" color="#008000"&gt;&lt;STRONG&gt;Kees Stolker&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;A big fan of Power Query and Excel&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 21:33:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418372#M146641</guid>
      <dc:creator>PwerQueryKees</dc:creator>
      <dc:date>2025-02-19T21:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418379#M146643</link>
      <description>&lt;P&gt;I know they work differently.&lt;BR /&gt;I could have used python, C, etc as the example (It's just a for loop with an IF) but gave Excel as it's a common reference point in this forum.&lt;BR /&gt;&lt;BR /&gt;Note, you can do index/row references in power query in a couple different ways&lt;BR /&gt;&lt;BR /&gt;But I can figure out how to reference the same column as is being calculated.&lt;BR /&gt;It's the self column ref in combination that is the issue for me.&lt;BR /&gt;IE a dynamic self referenced column.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 22:02:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4418379#M146643</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-19T22:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4419231#M146666</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="922807" data-lia-user-login="TuqueLogic" class="lia-mention lia-mention-user"&gt;TuqueLogic&lt;/a&gt;,&amp;nbsp;check this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;version with index (slower)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlDSUTIyMDLVNzAEIqVYnWglQ2QhI7CQEZKQoQFYyBhZlQVYyARZlTFYyBRNKBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Index = _t, Date = _t]),
    ChangedType = Table.TransformColumnTypes(Source,{{"Index", Int64.Type}, {"Date", type date}}),
    Ad_AdjustedDate = Table.AddColumn(ChangedType, "Adjusted Date", each let a = try ChangedType{[Index]-1} otherwise [Date=[Date]] in if [Date] &amp;gt; a[Date] then [Date] else a[Date], type date)
in
    Ad_AdjustedDate&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;much faster version (index column is not needed)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtU3MAQipVgdJK4RCtfQAFXWAlXWGIMbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
    ChangedType = Table.TransformColumnTypes(Source,{{"Date", type date}}),
    Ad_PevDate = Table.FromColumns(Table.ToColumns(ChangedType) &amp;amp; {{null} &amp;amp; List.RemoveLastN(ChangedType[Date], 1)}, Value.Type(Table.FirstN(ChangedType, 0) &amp;amp; #table(type table[PrevDate=date], {}))),
    Ad_AdjustedDate = Table.AddColumn(Ad_PevDate, "Adjusted Date", each if [Date] &amp;gt; ([PrevDate] ?? [Date]) then [Date] else ([PrevDate] ?? [Date]), type date),
    RemovedColumns = Table.RemoveColumns(Ad_AdjustedDate,{"PrevDate"})
in
    RemovedColumns&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 20 Feb 2025 08:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4419231#M146666</guid>
      <dc:creator>dufoq3</dc:creator>
      <dc:date>2025-02-20T08:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4419375#M146670</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="922807" data-lia-user-login="TuqueLogic" class="lia-mention lia-mention-user"&gt;TuqueLogic&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;another solution with Table.Group and GroupKind.Local&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;let&lt;BR /&gt;Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtU3MAQipVgdJK4RCtfQAFXWAlXWGIMbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),&lt;BR /&gt;ChangedType = Table.TransformColumnTypes(Source,{{"Date", type date}}),&lt;BR /&gt;&lt;BR /&gt;Group = Table.Group(ChangedType, {"Date"}, {{"Data", each _}}, GroupKind.Local, (x,y)=&amp;gt; Byte.From(x[Date]&amp;lt;y[Date])),&lt;BR /&gt;Rename = Table.RenameColumns(Group,{{"Date", "AdjustedDate"}}),&lt;BR /&gt;Expand = Table.ExpandTableColumn(Rename, "Data", {"Date"}, {"Date"})&lt;BR /&gt;in&lt;BR /&gt;Expand&lt;/PRE&gt;
&lt;P&gt;Stéphane&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 09:34:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4419375#M146670</guid>
      <dc:creator>slorin</dc:creator>
      <dc:date>2025-02-20T09:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420277#M146711</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;I don't see how this is recursive.&amp;nbsp; But that may just be me.&lt;/P&gt;&lt;P&gt;The date to use is not necessarily only 1 row previous relative to the index.&amp;nbsp;&lt;BR /&gt;The date to use may be many rows previous.&lt;BR /&gt;&lt;BR /&gt;As well the column index is needed as the original dates are not necessarily relevant to the operation.&lt;BR /&gt;&lt;BR /&gt;If it was only a shift of 1 or 2 I was concerned with I would just created index shifted merged columns and evaluate at a row level with DAX.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And here all I did was replace the hashtable that determines the initial input and it doesn't work in this cae.&lt;BR /&gt;I don't understand why not, but this is the result.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 18:32:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420277#M146711</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-20T18:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420287#M146712</link>
      <description>&lt;P&gt;The dates aren't relevant to the adjusted date. IE 2 entries in the date column can be the same date but have 2 different adjusted dates.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2025 17:19:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420287#M146712</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-20T17:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420719#M146728</link>
      <description>&lt;P&gt;I realize that using the Excel example confused the situation as I require being able to go back until a condtion is met, hence recursion.&lt;BR /&gt;&lt;BR /&gt;This is the approximate form of the function DateRec()&lt;BR /&gt;= (x as number) as date =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;f=if ( DateTable{x}[Date] &amp;gt;= DateTable{x-1}[ImportDate] ) then DateTable{x}[Date] else DateRec(x-1)&lt;BR /&gt;in&lt;BR /&gt;if( x = 0) then DateTable{x}[Date] else f&lt;BR /&gt;&lt;BR /&gt;But it is not letting me reference the column it is being used to create,&amp;nbsp;DateTable[ImportDate].&lt;BR /&gt;Yet in the reference tutorial below, that is exactly what was done.&lt;/P&gt;&lt;P&gt;But the author chose the same column name as the function name so there is some abiguity in the functional relationships in the code and process.&lt;BR /&gt;(why the function and column were not called fibbFct and fibbCol or similar is beyond me)&lt;BR /&gt;&lt;A href="https://radacad.com/fibonacci-sequence-understanding-the-power-query-recursive-function" target="_blank" rel="noopener"&gt;https://radacad.com/fibonacci-sequence-understanding-the-power-query-recursive-function&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Example of what the table should look like in the end below.&lt;BR /&gt;The first two columns are given, the ImportDate Column is the one to be created via the Invoke Custom Function:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 00:32:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420719#M146728</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-02-21T00:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420997#M146741</link>
      <description>&lt;P&gt;Maybe this is what you are looking for. Just a note, though, that recursions usually perform very badly in Power Query and there is usually a way more performant, non-recursive method to get the same results. This is partly why lots of people are giving you non-recursive solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SourceData:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Index&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;5/1/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5/12/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4/1/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;4/1/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4/1/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;5/23/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;5/19/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;6/1/2025&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;5/28/2025&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;&lt;LI-CODE lang="markup"&gt;let
    Source = SourceData,
    
    AddPreviousHigher = 
    let 
        srcBuf = Table.Buffer( Source )
    in 
        Table.AddColumn(
            srcBuf, 
            "PreviousHigherDate", 
            each let 
                recF = ( x as number ) =&amp;gt; 
                let thisDate =  srcBuf{x}[Date] in
                if x = 0 
                    then thisDate 
                    else let prevDate = srcBuf{x-1}[Date] in 
                        if thisDate &amp;gt; prevDate
                            then thisDate 
                            else @recF( x - 1) //recursion
            in 
                recF([Index]),
            type date
        )
in
    AddPreviousHigher&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: realized I got the recursive logic wrong, tweaked to reflect OP's clarificaiton&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 04:39:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420997#M146741</guid>
      <dc:creator>MarkLaf</dc:creator>
      <dc:date>2025-02-21T04:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4421532#M146767</link>
      <description>&lt;P&gt;In addition to my &lt;A href="https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4420997/highlight/true#M146741" target="_self"&gt;answer with a recursive function&lt;/A&gt;, if you are looking for an answer that I I believe still meets your criteria and performs better, take a look at this method that uses List.Generate. We take advantage of the fact that, for any given index, if the [Current Date] &amp;lt;= [Previous Date] then the current [Adjusted Date] should inherit from previous Index's [Adjusted Date]. Perhaps this is the 'recursion' / 'reference to previous calculation in column' behavior you are looking for?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on some quick tests on my machine using a query to generate x rows of Index|Date (date range set to 1/1/2025..12/31/2026), whereas my other solution with the recursive function&amp;nbsp;can process 6k rows in ~35s, this can process 1m rows in the same amount of time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = SourceData1m,
    Ind = List.Buffer( Source[Index] ),
    Dat = List.Buffer( Source[Date] ),
    Gen = 
    List.Generate( 
        ()=&amp;gt;[i=0,adj=List.First( Dat )], 
        each [i] &amp;lt; List.Count( Ind ), 
        each [ 
            i = [i] + 1, 
            adj = 
            let 
                prevAdjAnswer = [adj], 
                prevDate = Dat{[i]}, 
                curDate = Dat{[i]+1} 
            in
                if prevDate = null 
                    then curDate 
                    else if curDate &amp;gt; prevDate 
                        then curDate 
                        else prevAdjAnswer 
        ], 
        each
        [adj]
    ),
    ToTable = Table.FromColumns( 
        { Ind, Dat, Gen }, 
        type table [ Index = Int64.Type, Date = date, Adjusted Date = date ]
    )
in
    ToTable&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If curious, here is the M I used to generate the dummy data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SourceData1m&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table.FromRecords( 
    List.Generate( 
        ()=&amp;gt;0, 
        each _ &amp;lt; 1000000, 
        each _+1, 
        each [ 
            Index = _, 
            Date = Date.From( Int64.From( Number.RandomBetween( 45657.5, 46387.499 ) ) ) 
        ] 
    ), 
    type table [Index=Int64.Type, Date=date] 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 08:53:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4421532#M146767</guid>
      <dc:creator>MarkLaf</dc:creator>
      <dc:date>2025-02-21T08:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4423926#M146897</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="922807" data-lia-user-login="TuqueLogic" class="lia-mention lia-mention-user"&gt;TuqueLogic&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If any of the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 06:28:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4423926#M146897</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-02-24T06:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4588002#M147135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="922807" data-lia-user-login="TuqueLogic" class="lia-mention lia-mention-user"&gt;TuqueLogic&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 12:58:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4588002#M147135</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-02-27T12:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4591563#M147331</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="922807" data-lia-user-login="TuqueLogic" class="lia-mention lia-mention-user"&gt;TuqueLogic&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;SPAN data-teams="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Mar 2025 06:12:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4591563#M147331</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-03-02T06:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query Recursion: Simple reference of same row</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4595559#M147527</link>
      <description>&lt;P&gt;None of these are the solution.&lt;BR /&gt;I found a way in DAX for now but it is very computationally expensive.&lt;BR /&gt;I plan to revisit this recursion later.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 21:29:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-Recursion-Simple-reference-of-same-row/m-p/4595559#M147527</guid>
      <dc:creator>TuqueLogic</dc:creator>
      <dc:date>2025-03-04T21:29:54Z</dc:date>
    </item>
  </channel>
</rss>

