Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 48330

Re: Is there a way to crate parent Child relationship on the same table and show results in a table?

$
0
0

amithegde wrote:

Thanks @Eric_Zhang

 

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.

 

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.

 

Thanks for the help.. Smiley Happy


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.

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] )        //&& [pathLen2] - [pathLen]
        //<= 1
)

Viewing all articles
Browse latest Browse all 48330

Trending Articles