<?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 - Need next row value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2173667#M50531</link>
    <description>&lt;P&gt;I am still unable to get it to return the information I need.. Would it help if I sent the current Source Logic and see what parts I should update to incorporate your logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Excel.Workbook(File.Contents("C:\Users\justi\Desktop\TG\Power BI\Quickbooks\General Ledger.xlsx"), null, false),&lt;BR /&gt;#"General Ledger_sheet" = Source{[Item="General Ledger",Kind="Sheet"]}[Data],&lt;BR /&gt;FilterNullAndWhitespace = each List.Select(_, each _ &amp;lt;&amp;gt; null and (not (_ is text) or Text.Trim(_) &amp;lt;&amp;gt; "")),&lt;BR /&gt;#"Removed Bottom Rows" = Table.RemoveLastN(#"General Ledger_sheet", each try List.IsEmpty(List.Skip(FilterNullAndWhitespace(Record.FieldValues(_)), 1)) otherwise false),&lt;BR /&gt;#"Removed Top Rows" = Table.Skip(#"Removed Bottom Rows", each try List.IsEmpty(List.Skip(FilterNullAndWhitespace(Record.FieldValues(_)), 1)) otherwise false),&lt;BR /&gt;#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Column1", type text}, {"Date", type text}, {"Account", type text}, {"Transaction Type", type text}, {"Num", type any}, {"Memo/Description", type text}, {"Split", type text}, {"Amount", type number}, {"Balance", type number}, {"Name", type text}}),&lt;BR /&gt;#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Weird Name"}}),&lt;BR /&gt;#"Added Index" = Table.AddIndexColumn(#"Renamed Columns", "Index", 1, 1, Int64.Type),&lt;BR /&gt;#"Sorted Rows" = Table.Sort(#"Added Index",{{"Index", Order.Ascending}})&lt;BR /&gt;in&lt;BR /&gt;#"Sorted Rows"&lt;/P&gt;</description>
    <pubDate>Fri, 05 Nov 2021 01:07:50 GMT</pubDate>
    <dc:creator>JusticeBaird</dc:creator>
    <dc:date>2021-11-05T01:07:50Z</dc:date>
    <item>
      <title>DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2171739#M50433</link>
      <description>&lt;P&gt;Hello -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to create a new column utilizing DAX (or taking advice on how to accomplish the following).&amp;nbsp; I have a dataset that sometimes includes 'Beginning Balance' for [Date] and&amp;nbsp;&lt;EM&gt;Null&amp;nbsp;&lt;/EM&gt;for [Account].&amp;nbsp; I am trying to replace the &lt;EM&gt;Null&lt;/EM&gt;&amp;nbsp;with the next rows value (within the same column).&amp;nbsp; Please reference the attached picture for current data set on the left and my future goal on the right.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Justice&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;</description>
      <pubDate>Thu, 04 Nov 2021 03:03:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2171739#M50433</guid>
      <dc:creator>JusticeBaird</dc:creator>
      <dc:date>2021-11-04T03:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172224#M50450</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="336784" data-lia-user-login="JusticeBaird" class="lia-mention lia-mention-user"&gt;JusticeBaird&lt;/a&gt;&amp;nbsp;&amp;nbsp;Could you paste the data on which to calculate the column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx,&lt;/P&gt;&lt;P&gt;B.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 08:58:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172224#M50450</guid>
      <dc:creator>BeaBF</dc:creator>
      <dc:date>2021-11-04T08:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172822#M50481</link>
      <description>&lt;P&gt;Sample data is stated below&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="202311" data-lia-user-login="BeaBF" class="lia-mention lia-mention-user"&gt;BeaBF&lt;/a&gt; . Please note that my only goal is to bring in the applicable account name for for the blank 'Beginning Balance' rows.&amp;nbsp; Please let me know if you have any further questions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Account&amp;nbsp; &amp;nbsp; &amp;nbsp;| Amount&amp;nbsp; &amp;nbsp; &amp;nbsp;| Balance&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beg Bal.&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 1000&lt;/P&gt;&lt;P&gt;1/4/2021 | Bank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; -100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | 900&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beg Bal.&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 5000&lt;/P&gt;&lt;P&gt;1/11/21&amp;nbsp; | A/P&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp;-500&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| 4500&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:24:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172822#M50481</guid>
      <dc:creator>JusticeBaird</dc:creator>
      <dc:date>2021-11-04T14:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172831#M50483</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="336784" data-lia-user-login="JusticeBaird" class="lia-mention lia-mention-user"&gt;JusticeBaird&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes, but if the lines were not in this order, you need a rule to assign the occunt bank rather than loan. what is this rule?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:30:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172831#M50483</guid>
      <dc:creator>BeaBF</dc:creator>
      <dc:date>2021-11-04T14:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172910#M50492</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="336784" data-lia-user-login="JusticeBaird" class="lia-mention lia-mention-user"&gt;JusticeBaird&lt;/a&gt;&amp;nbsp; this is not an analysis level task, rather it is a data level task which can be resolved by using PQ in the following way&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;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckpNV3BKzFHSUYIgQwMDA6VYnWglIwMjQ10DIDIBijol5mUDKV2gLJCyhCpB12uKotcQpB0o6qgfANJqCtZqAqJiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Account = _t, Amount = _t, Balance = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type text}, {"Account", type text}, {"Amount", Int64.Type}, {"Balance", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
    #"Added Custom" = Table.AddColumn(#"Added Index", "newAccount", each let x = #"Added Index"[Account],
    y = #"Added Index"[Date],
    z = if [Date]="Beg Bal" then x{[Index]+1} else [Account]

    in z),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
    #"Removed Columns"&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:11:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2172910#M50492</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-04T15:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2173650#M50529</link>
      <description>&lt;P&gt;I copy/pasted you logic and came up with the same results as you, now which part of the logic to I need to update to return the full table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 00:38:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2173650#M50529</guid>
      <dc:creator>JusticeBaird</dc:creator>
      <dc:date>2021-11-05T00:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2173654#M50530</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="336784" data-lia-user-login="JusticeBaird" class="lia-mention lia-mention-user"&gt;JusticeBaird&lt;/a&gt;&amp;nbsp;try running the code from #"Added Index" onwards in your original dataset. It should not create any issue.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 00:41:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2173654#M50530</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-05T00:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Need next row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2173667#M50531</link>
      <description>&lt;P&gt;I am still unable to get it to return the information I need.. Would it help if I sent the current Source Logic and see what parts I should update to incorporate your logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;Source = Excel.Workbook(File.Contents("C:\Users\justi\Desktop\TG\Power BI\Quickbooks\General Ledger.xlsx"), null, false),&lt;BR /&gt;#"General Ledger_sheet" = Source{[Item="General Ledger",Kind="Sheet"]}[Data],&lt;BR /&gt;FilterNullAndWhitespace = each List.Select(_, each _ &amp;lt;&amp;gt; null and (not (_ is text) or Text.Trim(_) &amp;lt;&amp;gt; "")),&lt;BR /&gt;#"Removed Bottom Rows" = Table.RemoveLastN(#"General Ledger_sheet", each try List.IsEmpty(List.Skip(FilterNullAndWhitespace(Record.FieldValues(_)), 1)) otherwise false),&lt;BR /&gt;#"Removed Top Rows" = Table.Skip(#"Removed Bottom Rows", each try List.IsEmpty(List.Skip(FilterNullAndWhitespace(Record.FieldValues(_)), 1)) otherwise false),&lt;BR /&gt;#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),&lt;BR /&gt;#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Column1", type text}, {"Date", type text}, {"Account", type text}, {"Transaction Type", type text}, {"Num", type any}, {"Memo/Description", type text}, {"Split", type text}, {"Amount", type number}, {"Balance", type number}, {"Name", type text}}),&lt;BR /&gt;#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Weird Name"}}),&lt;BR /&gt;#"Added Index" = Table.AddIndexColumn(#"Renamed Columns", "Index", 1, 1, Int64.Type),&lt;BR /&gt;#"Sorted Rows" = Table.Sort(#"Added Index",{{"Index", Order.Ascending}})&lt;BR /&gt;in&lt;BR /&gt;#"Sorted Rows"&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 01:07:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Need-next-row-value/m-p/2173667#M50531</guid>
      <dc:creator>JusticeBaird</dc:creator>
      <dc:date>2021-11-05T01:07:50Z</dc:date>
    </item>
  </channel>
</rss>

