<?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 Is there a way to crate parent Child relationship on the same table and show results in a table? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/76352#M2624</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ItemId | ParentId&lt;BR /&gt;1 | 0&lt;BR /&gt;2 | 1&lt;BR /&gt;3 | 1&lt;BR /&gt;4 | 2&lt;BR /&gt;5 | 3&lt;BR /&gt;6 | 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parent Id can be ItemId of another row in the same table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I would like to have a slicer on my dashboard and when I select ItemId 1 on a slicer, I should get rows with Item Id 1, 2, 3 on the resulting table. If I select 2 on the slicer, resulting table will show rows with Id, 2, 4, 6.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Oct 2016 00:14:28 GMT</pubDate>
    <dc:creator>amithegde</dc:creator>
    <dc:date>2016-10-08T00:14:28Z</dc:date>
    <item>
      <title>Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/76352#M2624</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ItemId | ParentId&lt;BR /&gt;1 | 0&lt;BR /&gt;2 | 1&lt;BR /&gt;3 | 1&lt;BR /&gt;4 | 2&lt;BR /&gt;5 | 3&lt;BR /&gt;6 | 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parent Id can be ItemId of another row in the same table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I would like to have a slicer on my dashboard and when I select ItemId 1 on a slicer, I should get rows with Item Id 1, 2, 3 on the resulting table. If I select 2 on the slicer, resulting table will show rows with Id, 2, 4, 6.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2016 00:14:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/76352#M2624</guid>
      <dc:creator>amithegde</dc:creator>
      <dc:date>2016-10-08T00:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/76467#M2630</link>
      <description>&lt;P&gt;For creating parent child hierarchy in PowerBI, You can refer this bolg at &lt;A href="http://www.wiseowl.co.uk/blog/s2479/parent-child-hierarchy.htm" target="_blank"&gt;here&lt;/A&gt;.&amp;nbsp; It would be better if you post your sample table and expected output for us to recreate a solution for you.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2016 06:20:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/76467#M2630</guid>
      <dc:creator>BhaveshPatel</dc:creator>
      <dc:date>2016-10-09T06:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77046#M2660</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you mean show result in a table? It would be much easier to aggrgate the values rather than show the rows. Could you be more specific? Anyway to get your requirement in the original post, you will need to create a calculated table. Check the sample in the attached pbix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Table = 
FILTER (
    CROSSJOIN (
        SELECTCOLUMNS (
            Table1,
            "Itemid", Table1[ItemId],
            "pathLen", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        ),
        SELECTCOLUMNS (
            Table1,
            "Itemid2", Table1[ItemId],
            "ParentID2", Table1[ParentId],
            "path2", PATH ( Table1[ItemId], Table1[ParentId] ),
            "pathLen2", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        )
    ),
    PATHCONTAINS ( [path2], [Itemid] )
        &amp;amp;&amp;amp; [pathLen2] - [pathLen]
        &amp;lt;= 1
)&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/16219iF1229101639EEC7B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 08:16:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77046#M2660</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-10-11T08:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77332#M2683</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apologies for being vague. By table I meant `table` visualization control. The idea is to be able to browse/see children of a selected item in a tabular format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer you posted is very close. I am looking for a slight modification: If `1` selected on the slicer on the sample, table on the right should display all of the rows (Item ID 1 -6) as they are all children of 1. As of now it works for only one level, in the sense if 3 is selected on the slicer, it shows 3 and 5 which is level 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 17:58:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77332#M2683</guid>
      <dc:creator>amithegde</dc:creator>
      <dc:date>2016-10-11T17:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77333#M2684</link>
      <description>&lt;P&gt;thanks for the link&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/10288"&gt;@BhaveshPatel﻿&lt;/a&gt;&amp;nbsp;I got some ideas from it&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 17:58:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77333#M2684</guid>
      <dc:creator>amithegde</dc:creator>
      <dc:date>2016-10-11T17:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77454#M2689</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apologies for being vague. By table I meant `table` visualization control. The idea is to be able to browse/see children of a selected item in a tabular format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer you posted is very close. I am looking for a slight modification: If `1` selected on the slicer on the sample, table on the right should display all of the rows (Item ID 1 -6) as they are all children of 1. &lt;STRONG&gt;As of now it works for only one level&lt;/STRONG&gt;, in the sense if 3 is selected on the slicer, it shows 3 and 5 which is level 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It works for only one level because I've followed the description in your original post. To achieve the new requirement, you can just remove the filter.&lt;/P&gt;&lt;PRE&gt;Table = 
FILTER (
    CROSSJOIN (
        SELECTCOLUMNS (
            Table1,
            "Itemid", Table1[ItemId],
            "pathLen", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        ),
        SELECTCOLUMNS (
            Table1,
            "Itemid2", Table1[ItemId],
            "ParentID2", Table1[ParentId],
            "path2", PATH ( Table1[ItemId], Table1[ParentId] ),
            "pathLen2", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        )
    ),
    PATHCONTAINS ( [path2], [Itemid] )
&lt;STRIKE&gt;        //&amp;amp;&amp;amp; [pathLen2] - [pathLen]
        //&amp;lt;= 1&lt;/STRIKE&gt;
)&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Oct 2016 01:40:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77454#M2689</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-10-12T01:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77499#M2692</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apologies for being vague. By table I meant `table` visualization control. The idea is to be able to browse/see children of a selected item in a tabular format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer you posted is very close. I am looking for a slight modification: If `1` selected on the slicer on the sample, table on the right should display all of the rows (Item ID 1 -6) as they are all children of 1. &lt;STRONG&gt;As of now it works for only one level&lt;/STRONG&gt;, in the sense if 3 is selected on the slicer, it shows 3 and 5 which is level 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It works for only one level because I've followed the description in your original post. To achieve the new requirement, you can just remove the filter.&lt;/P&gt;&lt;PRE&gt;Table = 
FILTER (
    CROSSJOIN (
        SELECTCOLUMNS (
            Table1,
            "Itemid", Table1[ItemId],
            "pathLen", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        ),
        SELECTCOLUMNS (
            Table1,
            "Itemid2", Table1[ItemId],
            "ParentID2", Table1[ParentId],
            "path2", PATH ( Table1[ItemId], Table1[ParentId] ),
            "pathLen2", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        )
    ),
    PATHCONTAINS ( [path2], [Itemid] )
&lt;STRIKE&gt;        //&amp;amp;&amp;amp; [pathLen2] - [pathLen]
        //&amp;lt;= 1&lt;/STRIKE&gt;
)&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works perfect, except that if any value other than `null` which is not in the list ItemId is provided for the first row's parent. Is that a limitation of the CrossJoin?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 04:53:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77499#M2692</guid>
      <dc:creator>amithegde</dc:creator>
      <dc:date>2016-10-12T04:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77507#M2693</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;apologies for being vague. By table I meant `table` visualization control. The idea is to be able to browse/see children of a selected item in a tabular format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer you posted is very close. I am looking for a slight modification: If `1` selected on the slicer on the sample, table on the right should display all of the rows (Item ID 1 -6) as they are all children of 1. &lt;STRONG&gt;As of now it works for only one level&lt;/STRONG&gt;, in the sense if 3 is selected on the slicer, it shows 3 and 5 which is level 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It works for only one level because I've followed the description in your original post. To achieve the new requirement, you can just remove the filter.&lt;/P&gt;
&lt;PRE&gt;Table = 
FILTER (
    CROSSJOIN (
        SELECTCOLUMNS (
            Table1,
            "Itemid", Table1[ItemId],
            "pathLen", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        ),
        SELECTCOLUMNS (
            Table1,
            "Itemid2", Table1[ItemId],
            "ParentID2", Table1[ParentId],
            "path2", PATH ( Table1[ItemId], Table1[ParentId] ),
            "pathLen2", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        )
    ),
    PATHCONTAINS ( [path2], [Itemid] )
&lt;STRIKE&gt;        //&amp;amp;&amp;amp; [pathLen2] - [pathLen]
        //&amp;lt;= 1&lt;/STRIKE&gt;
)&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works perfect, &lt;STRONG&gt;except that if any value other than `null` which is not in the list ItemId is provided for the first row's parent&lt;/STRONG&gt;. Is that a limitation of the CrossJoin?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is actually a limitation of &lt;A href="https://msdn.microsoft.com/en-us/library/gg492167.aspx" target="_self"&gt;PATH&lt;/A&gt;. By the way, why a not existed ItemID as ParentId, it doesn't make sense for me, in my opinion, the top level shouldn't have any ParentId, namely the ParentId should be null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 05:58:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77507#M2693</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-10-12T05:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77511#M2695</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apologies for being vague. By table I meant `table` visualization control. The idea is to be able to browse/see children of a selected item in a tabular format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer you posted is very close. I am looking for a slight modification: If `1` selected on the slicer on the sample, table on the right should display all of the rows (Item ID 1 -6) as they are all children of 1. &lt;STRONG&gt;As of now it works for only one level&lt;/STRONG&gt;, in the sense if 3 is selected on the slicer, it shows 3 and 5 which is level 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It works for only one level because I've followed the description in your original post. To achieve the new requirement, you can just remove the filter.&lt;/P&gt;&lt;PRE&gt;Table = 
FILTER (
    CROSSJOIN (
        SELECTCOLUMNS (
            Table1,
            "Itemid", Table1[ItemId],
            "pathLen", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        ),
        SELECTCOLUMNS (
            Table1,
            "Itemid2", Table1[ItemId],
            "ParentID2", Table1[ParentId],
            "path2", PATH ( Table1[ItemId], Table1[ParentId] ),
            "pathLen2", PATHLENGTH ( PATH ( Table1[ItemId], Table1[ParentId] ) )
        )
    ),
    PATHCONTAINS ( [path2], [Itemid] )
&lt;STRIKE&gt;        //&amp;amp;&amp;amp; [pathLen2] - [pathLen]
        //&amp;lt;= 1&lt;/STRIKE&gt;
)&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works perfect, &lt;STRONG&gt;except that if any value other than `null` which is not in the list ItemId is provided for the first row's parent&lt;/STRONG&gt;. Is that a limitation of the CrossJoin?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is actually a limitation of &lt;A href="https://msdn.microsoft.com/en-us/library/gg492167.aspx" target="_self"&gt;PATH&lt;/A&gt;. By the way, why a not existed ItemID as ParentId, it doesn't make sense for me, in my opinion, the top level shouldn't have any ParentId, namely the ParentId should be null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When parent&amp;nbsp;Id can be from another table, while some of the parents can be from the current table, there can be parents which are not found on the current table as ItemId. For the simplified example above, I just mentioned `0` to represent some value which is not in the ItemId.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Id | Title&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;100 | abc&lt;/P&gt;&lt;P&gt;200 | abcd&lt;/P&gt;&lt;P&gt;300 | abcde&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Id | ParentId | Title&lt;/P&gt;&lt;P&gt;1 | 300 | xyz &amp;nbsp;--&amp;gt; parent from another table&lt;/P&gt;&lt;P&gt;2 | 1 &amp;nbsp; &amp;nbsp; | xyz1 &amp;nbsp;--&amp;gt; parent from current table&lt;/P&gt;&lt;P&gt;3 | 2 &amp;nbsp; &amp;nbsp; | &amp;nbsp;xyz2&amp;nbsp;&lt;/P&gt;&lt;P&gt;4 | 100 | xyz3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 06:10:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77511#M2695</guid>
      <dc:creator>amithegde</dc:creator>
      <dc:date>2016-10-12T06:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77527#M2696</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the clarification, however I don't get the point of such table design. Anyway, to bypass such limitation, add an extra column as the ParentID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;new ParentID = LOOKUPVALUE(Table3[ItemId],Table3[ItemId],Table3[ParentID])&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/16375iAC37D465AE717D5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 06:39:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/77527#M2696</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-10-12T06:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to crate parent Child relationship on the same table and show results in a table?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/4013581#M53760</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/15280"&gt;@amithegde&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you find a way to solve your requirement? I have the same requirement but getting errors due to PATH limitations as mentioned by Eric above. If possible, can you please be kind enought to share the solution you applied?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 13:57:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Is-there-a-way-to-crate-parent-Child-relationship-on-the-same/m-p/4013581#M53760</guid>
      <dc:creator>ranjeewas</dc:creator>
      <dc:date>2024-06-27T13:57:30Z</dc:date>
    </item>
  </channel>
</rss>

