Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
surbhimanu
New Member

Parent Child Data Manipulation

I have below data

surbhimanu_0-1719320417967.png

The requirement is to create new column(s) and insert the data from child rating as below, rating of child column should be inserted to the parent row

surbhimanu_2-1719320594185.png

 

 

 

1 ACCEPTED SOLUTION
WanderingBI
Resolver III
Resolver III

From data modelling point of view I would not advise to create two rating columns.

 

I would recommend to do it like this (use inner join to merge the table with itself):

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUcorzckBUsZAHJBYlJpXohSrE61kBOSCZE2A2DkjMycFLGoMFTVEETVBmGKEaoop1ARUU8ygIqYoouY4TbEAcs2hTkSot4SKGqGIGhogjDFFNcYQ7CcDDIMMjWHiqM40xO0vQ1OElCGSVCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"RequestID -" = _t, RequestParentId = _t, Rating = _t, Type = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"RequestID -", Int64.Type}, {"RequestParentId", Int64.Type}, {"Rating", Int64.Type}, {"Type", type text}}),
    #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"RequestID -"}, data, {"RequestParentId"}, "data", JoinKind.LeftOuter),
    #"Expanded data" = Table.ExpandTableColumn(#"Merged Queries", "data", {"RequestID -", "Rating"}, {"RequestID -.1", "Rating.1"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded data",{{"RequestID -.1", "RequestID_Child"}, {"Rating.1", "Rating_Child"}})
in
    #"Renamed Columns"

 

WanderingBI_1-1719294234541.png

 

 

Possible Matrix visualization:

WanderingBI_0-1719294172789.png

 

View solution in original post

1 REPLY 1
WanderingBI
Resolver III
Resolver III

From data modelling point of view I would not advise to create two rating columns.

 

I would recommend to do it like this (use inner join to merge the table with itself):

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUcorzckBUsZAHJBYlJpXohSrE61kBOSCZE2A2DkjMycFLGoMFTVEETVBmGKEaoop1ARUU8ygIqYoouY4TbEAcs2hTkSot4SKGqGIGhogjDFFNcYQ7CcDDIMMjWHiqM40xO0vQ1OElCGSVCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"RequestID -" = _t, RequestParentId = _t, Rating = _t, Type = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"RequestID -", Int64.Type}, {"RequestParentId", Int64.Type}, {"Rating", Int64.Type}, {"Type", type text}}),
    #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"RequestID -"}, data, {"RequestParentId"}, "data", JoinKind.LeftOuter),
    #"Expanded data" = Table.ExpandTableColumn(#"Merged Queries", "data", {"RequestID -", "Rating"}, {"RequestID -.1", "Rating.1"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded data",{{"RequestID -.1", "RequestID_Child"}, {"Rating.1", "Rating_Child"}})
in
    #"Renamed Columns"

 

WanderingBI_1-1719294234541.png

 

 

Possible Matrix visualization:

WanderingBI_0-1719294172789.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.