Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have below data
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
Solved! Go to Solution.
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"
Possible Matrix visualization:
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"
Possible Matrix visualization:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 3 |