<?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's PATH function equivalent Custom Column in Power Query in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2889986#M910</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="63535" data-lia-user-login="Oscar_Mtz_V" class="lia-mention lia-mention-user"&gt;Oscar_Mtz_V&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know how to modify it to display list of Salary instead of values of Parent column, but path is still related to Child and Parent columns ?&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2022 17:27:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-07T17:27:44Z</dc:date>
    <item>
      <title>DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/800386#M391</link>
      <description>&lt;P&gt;This custom column formula in Power Query provides an equivalent of DAX's PATH function.&lt;/P&gt;
&lt;P&gt;If you have many levels (PATHLENGTH is greater than say 10), it can save you time having to create calculated columns to get each PATHITEM&lt;BR /&gt;&lt;BR /&gt;With Power Query, you can simply split the PATH into PATHITEMS with one click.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just change the text in Red Color font in below formula according to your column names and previous step name. See the picture for guidance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;=let //Define your columns below
 c=[&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Child&lt;/FONT&gt;&lt;/STRONG&gt;],p=[&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Parent&lt;/STRONG&gt;&lt;/FONT&gt;],mytable=&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;#"Changed Type"&lt;/FONT&gt;&lt;/STRONG&gt;,pc="&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Parent&lt;/STRONG&gt;&lt;/FONT&gt;",cc="&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Child&lt;/FONT&gt;&lt;/STRONG&gt;" 
  in
let mylist={c} &amp;amp; List.Generate(()=&amp;gt;[x=0,y=p,w=1],each [w] &amp;gt; 0,each [z=[y], 
x=Table.Column(Table.SelectRows(mytable,each Record.Field(_,cc)=z),pc),y=x{0},w=List.Count(x)
],
each [y])
        in
Text.Combine(List.Reverse(List.RemoveItems(
List.Transform(mylist,each Text.From(_)),{null,""})),"|")&lt;/PRE&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;SPAN class="reportid hidden"&gt;&lt;/SPAN&gt;</description>
      <pubDate>Tue, 24 Sep 2019 07:43:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/800386#M391</guid>
      <dc:creator>Zubair_Muhammad</dc:creator>
      <dc:date>2019-09-24T07:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/800663#M392</link>
      <description>&lt;P&gt;Good work! Just to simplify the formula a bit:&lt;/P&gt;
&lt;PRE&gt;let //Define your columns here
mytable=&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ChangedType&lt;/FONT&gt;&lt;/STRONG&gt;,p="&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Parent&lt;/FONT&gt;&lt;/STRONG&gt;",c="&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Child&lt;/FONT&gt;&lt;/STRONG&gt;" 
  in
let mylist={Record.Field(_,c)} &amp;amp; List.Generate(()=&amp;gt;[x=0,y=Record.Field(_,p),w=1],each [w] &amp;gt; 0,each [z=[y], x=Table.Column(Table.SelectRows(mytable,each Record.Field(_,c)=z),p),y=x{0},w=List.Count(x)
],
each [y])
        in
Text.Combine(List.Reverse(List.RemoveItems(
List.Transform(mylist,each Text.From(_)),{null,""})),"|")&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 11:23:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/800663#M392</guid>
      <dc:creator>Daniil</dc:creator>
      <dc:date>2019-09-24T11:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/800676#M393</link>
      <description>&lt;P&gt;Thanks &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="15597" data-lia-user-login="Daniil" class="lia-mention lia-mention-user"&gt;Daniil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 11:42:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/800676#M393</guid>
      <dc:creator>Zubair_Muhammad</dc:creator>
      <dc:date>2019-09-24T11:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/873399#M403</link>
      <description>&lt;P&gt;Thanks to &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="15597" data-lia-user-login="Daniil" class="lia-mention lia-mention-user"&gt;Daniil&lt;/a&gt;&amp;nbsp;and &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;&amp;nbsp;. I created the custom column,with n&lt;SPAN style="font-family: inherit;"&gt;o syntax error in the Custom Column creation step. H&lt;/SPAN&gt;owever I receive an Error in the table view.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;= let //Define your columns here&lt;BR /&gt;mytable=#"Changed Type",p=[#"DirectReportTo Asso. No."],c=[#"Asso. No."] &lt;BR /&gt;in&lt;BR /&gt;let mylist={Record.Field(_,c)} &amp;amp; List.Generate(()=&amp;gt;[x=0,y=Record.Field(_,p),w=1],each [w] &amp;gt; 0,each [z=[y], x=Table.Column(Table.SelectRows(mytable,each Record.Field(_,c)=z),p),y=x{0},w=List.Count(x)&lt;BR /&gt;],&lt;BR /&gt;each [y])&lt;BR /&gt;in&lt;BR /&gt;Text.Combine(List.Reverse(List.RemoveItems(&lt;BR /&gt;List.Transform(mylist,each Text.From(_)),{null,""})),"|")&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 12:53:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/873399#M403</guid>
      <dc:creator>asoysal</dc:creator>
      <dc:date>2019-12-12T12:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/885109#M404</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="15597" data-lia-user-login="Daniil" class="lia-mention lia-mention-user"&gt;Daniil&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Either of the steps are too time consuming, it's been running for about 45 minutes and still hasn't been able to complete this step. Any help?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 10:15:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/885109#M404</guid>
      <dc:creator>a1b1c1</dc:creator>
      <dc:date>2019-12-27T10:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2251078#M800</link>
      <description>&lt;P&gt;I have tried this method and you are correct, this is much too inefficient. I have only 6,000 rows and we are talking hours to run. Did you find another solution?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 03:27:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2251078#M800</guid>
      <dc:creator>justlogmein</dc:creator>
      <dc:date>2021-12-22T03:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2461021#M838</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;&amp;nbsp;, thanks a lot!&lt;BR /&gt;Just a small note for those that might be working with records with orphan records (Parent = null), you might need to fill this with the same "child id". This code can come in handy:&lt;/P&gt;
&lt;PRE&gt;= Table.ReplaceValue(#"Replaced Errors",null, each _[Child],Replacer.ReplaceValue,{"Parent"})&lt;/PRE&gt;
&lt;P&gt;Cheers!&lt;/P&gt;
&lt;P&gt;Oscar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't forget to follow my BI blog in &lt;A title="BIBB" href="https://bibb.pro" target="_self"&gt;www.bibb.pro&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://bibb.pro" target="_self"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 07:20:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2461021#M838</guid>
      <dc:creator>Oscar_Mtz_V</dc:creator>
      <dc:date>2022-04-18T07:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2682008#M872</link>
      <description>&lt;P&gt;(Never mind: all others - pay attention to the previous step in the Query Editor which needs to be referenced... that was my error-cause. Performance is extremely show, though, using this Custom Column and then seperating it into levels for a hierarchy (I have eight levels in the hierarchy and a couple of thousand rows). Wonder if it will fix the issues I now face with Dax though!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting an Error as a result, what am I doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;= Table.AddColumn(#"Functionele accounts filteren", "Aangepast", each let //Define your columns here&lt;BR /&gt;mytable=#"Dim Medewerker",p="repto_id",c="res_id"&lt;BR /&gt;in&lt;BR /&gt;let mylist={Record.Field(_,c)} &amp;amp; List.Generate(()=&amp;gt;[x=0,y=Record.Field(_,p),w=1],each [w] &amp;gt; 0,each [z=[y], x=Table.Column(Table.SelectRows(mytable,each Record.Field(_,c)=z),p),y=x{0},w=List.Count(x)&lt;BR /&gt;],&lt;BR /&gt;each [y])&lt;BR /&gt;in&lt;BR /&gt;Text.Combine(List.Reverse(List.RemoveItems(&lt;BR /&gt;List.Transform(mylist,each Text.From(_)),{null,""})),"|"))&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 14:45:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2682008#M872</guid>
      <dc:creator>Guido_Beulen</dc:creator>
      <dc:date>2022-08-04T14:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2889986#M910</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="63535" data-lia-user-login="Oscar_Mtz_V" class="lia-mention lia-mention-user"&gt;Oscar_Mtz_V&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know how to modify it to display list of Salary instead of values of Parent column, but path is still related to Child and Parent columns ?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:27:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2889986#M910</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-07T17:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910063#M912</link>
      <description>&lt;P&gt;I wrote one that could do ~100,000 rows in ~20 seconds. Appends a column "PATH" to a table. Inspired by this BIAccountant post:&amp;nbsp;&lt;A href="https://www.thebiccountant.com/2021/02/10/guest-post-using-list-accumulate-for-input-output-genealogy/" target="_blank" rel="noopener"&gt;https://www.thebiccountant.com/2021/02/10/guest-post-using-list-accumulate-for-input-output-genealogy/,&lt;/A&gt;&amp;nbsp;but modified to be recursive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A record at the top of the hierarchy should have a null in the Parent field. There is no loop protection, so you don't want any records to be their own parents, their own grandparents, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that you only invoke the function once on the table as whole, not row-by-row. Add a step along the lines of:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;= fnAddPath(#"Previous Step", "ParentID Column Name", "SelfID Column Name")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(Self_Referential_Table as table,  Parent_Column_Name as text,  Self_Column_Name as text) =&amp;gt;
let
    #"Renamed Columns" = Table.RenameColumns(Self_Referential_Table, {{Self_Column_Name, "0"}, {Parent_Column_Name, "1"}}),
    Buffered = Table.Buffer(Table.SelectColumns(
            Table.RenameColumns(Self_Referential_Table,{{Self_Column_Name, "Child"},{Parent_Column_Name, "Parent"}}),{"Child", "Parent"}))
in
    let
        GetParents = (state as table, currentLevelFromLeaf as number) =&amp;gt;
        let
            NextParents = Table.ExpandTableColumn(
                                Table.NestedJoin(state, {Text.From(currentLevelFromLeaf)},
                                Buffered, {"Child"}, "NextLevel", JoinKind.LeftOuter),
                            "NextLevel", {"Parent"}, {Text.From(currentLevelFromLeaf + 1)}),
            result = if List.NonNullCount(Table.Column(NextParents,Text.From(currentLevelFromLeaf + 1))) = 0 then
                [resultTable = NextParents, maxHeight = currentLevelFromLeaf]
            else
                @GetParents(NextParents, currentLevelFromLeaf + 1)
        in
            result,

        //Reformat the Output
        ResultOutput = GetParents(#"Renamed Columns", 1),
        ListOfLevels = List.Transform(List.Numbers(Record.Field(ResultOutput, "maxHeight") + 1,Record.Field(ResultOutput, "maxHeight") + 2, -1), each Number.ToText(_)),
        OutputTable = Table.AddColumn(Record.Field(ResultOutput, "resultTable"), "PATH", 
            each Text.Combine(List.Transform(ListOfLevels, (x) =&amp;gt; Record.Field(_, x)), "|")),
        OutputTable2 = Table.RemoveColumns(Table.RenameColumns(
            OutputTable, {{"0", Self_Column_Name}, {"1", Parent_Column_Name}}),
            List.RemoveMatchingItems(ListOfLevels,{"0","1"}))
    in
        OutputTable2&lt;/LI-CODE&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;P&gt;Probably the final Reformatting could be done more cleverly and in fewer lines of code.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 20:40:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910063#M912</guid>
      <dc:creator>Scott_Parker</dc:creator>
      <dc:date>2022-11-16T20:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910485#M913</link>
      <description>&lt;P&gt;Hi Scott, Thank you for the code. I have a couple of question regarding the funvtion you have written. A small question what does it mean when u say "&lt;SPAN&gt;A topmost record should have a null in the Parent field". do i need to add a record ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 19:40:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910485#M913</guid>
      <dc:creator>mloyalka1996</dc:creator>
      <dc:date>2022-11-16T19:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910511#M914</link>
      <description>&lt;P&gt;I rephrased it. I meant a record at the top of the hierarchy, meaning it has no parents, should have Parent = null, rather than Parent = Self because it would result in infinite recursion.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 19:54:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910511#M914</guid>
      <dc:creator>Scott_Parker</dc:creator>
      <dc:date>2022-11-16T19:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910561#M915</link>
      <description>&lt;P&gt;thanks for that Scott. I created a coloumn called task_final. so whenevr Parent=self i replaced the value of child to null or kept the child value. Now when i am running the function with the following parameters. I still get an error. Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 20:18:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910561#M915</guid>
      <dc:creator>mloyalka1996</dc:creator>
      <dc:date>2022-11-16T20:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910603#M916</link>
      <description>&lt;P&gt;I have added clarification. Invoke the function on the table in one go, not for each row.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 20:42:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910603#M916</guid>
      <dc:creator>Scott_Parker</dc:creator>
      <dc:date>2022-11-16T20:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910624#M917</link>
      <description>&lt;P&gt;thank you scott for the clarification. I am bit new to power bi . I am trying to run function as a whole but I am not able to . It will be a big help if you can provide some help on how I can run the function as a whole&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 20:51:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/2910624#M917</guid>
      <dc:creator>mloyalka1996</dc:creator>
      <dc:date>2022-11-16T20:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/3297991#M986</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, I know this was posted a while ago, but I would be grateful if someone could help me. How can I extract only the last level of the path, as shown in the figure below? I should only leave the lines in red and get rid of the other lines.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 14:06:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/3297991#M986</guid>
      <dc:creator>toum</dc:creator>
      <dc:date>2023-06-22T14:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/4411707#M1162</link>
      <description>&lt;P&gt;Hi, I've modified the function adding a fourth parameter which is the Column Name you want the path to use for final display:&lt;BR /&gt;&lt;BR /&gt;Example when invoking the function (table, "ManagerId", "Id", "Column Name for PATH")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;(Self_Referential_Table as table, Parent_Column_Name as text, Self_Column_Name as text, Path_Column_Name as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;#"Renamed Columns" = Table.RenameColumns(Self_Referential_Table, {{Self_Column_Name, "0"}, {Parent_Column_Name, "1"}}),&lt;BR /&gt;Buffered = Table.Buffer(Table.SelectColumns(&lt;BR /&gt;Table.RenameColumns(Self_Referential_Table,{{Self_Column_Name, "Child"},{Parent_Column_Name, "Parent"}, {Path_Column_Name, "PathValue"}}),{"Child", "Parent", "PathValue"}))&lt;BR /&gt;in&lt;BR /&gt;let&lt;BR /&gt;GetParents = (state as table, currentLevelFromLeaf as number) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;NextParents = Table.ExpandTableColumn(&lt;BR /&gt;Table.NestedJoin(state, {Text.From(currentLevelFromLeaf)},&lt;BR /&gt;Buffered, {"Child"}, "NextLevel", JoinKind.LeftOuter),&lt;BR /&gt;"NextLevel", {"Parent", "PathValue"}, {Text.From(currentLevelFromLeaf + 1), "PathValue" &amp;amp; Text.From(currentLevelFromLeaf + 1)}),&lt;BR /&gt;result = if List.NonNullCount(Table.Column(NextParents, Text.From(currentLevelFromLeaf + 1))) = 0 then&lt;BR /&gt;[resultTable = NextParents, maxHeight = currentLevelFromLeaf]&lt;BR /&gt;else&lt;BR /&gt;@GetParents(NextParents, currentLevelFromLeaf + 1)&lt;BR /&gt;in&lt;BR /&gt;result,&lt;/P&gt;&lt;P&gt;// Reformat the Output&lt;BR /&gt;ResultOutput = GetParents(#"Renamed Columns", 1),&lt;BR /&gt;ListOfLevels = List.Transform(List.Numbers(1, Record.Field(ResultOutput, "maxHeight")), each "PathValue" &amp;amp; Text.From(_)),&lt;BR /&gt;OutputTable = Table.AddColumn(Record.Field(ResultOutput, "resultTable"), "PATH",&lt;BR /&gt;each Text.Combine(List.Transform(ListOfLevels, (x) =&amp;gt; try Record.Field(_, x) otherwise ""), "|")),&lt;BR /&gt;OutputTable2 = Table.RemoveColumns(Table.RenameColumns(&lt;BR /&gt;OutputTable, {{"0", Self_Column_Name}, {"1", Parent_Column_Name}}),&lt;BR /&gt;List.RemoveMatchingItems(List.Transform(List.Numbers(1, Record.Field(ResultOutput, "maxHeight")), each Text.From(_)), {"0", "1"})),&lt;BR /&gt;// Keep only original columns and PATH&lt;BR /&gt;FinalOutput = Table.SelectColumns(OutputTable2, Table.ColumnNames(Self_Referential_Table) &amp;amp; {"PATH"})&lt;BR /&gt;in&lt;BR /&gt;FinalOutput&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 20:19:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/4411707#M1162</guid>
      <dc:creator>FedeMosquera</dc:creator>
      <dc:date>2025-02-14T20:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: DAX's PATH function equivalent Custom Column in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/4412076#M1163</link>
      <description>&lt;P&gt;last level means it's a leaf, existing as child but not as parent, easy to verify.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2025 11:51:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DAX-s-PATH-function-equivalent-Custom-Column-in-Power-Query/m-p/4412076#M1163</guid>
      <dc:creator>RealSir</dc:creator>
      <dc:date>2025-02-15T11:51:33Z</dc:date>
    </item>
  </channel>
</rss>

