Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have table below likt that, some of the codes are missing the description against the item. I want to create a custom column in Power Query and re-generate the description according to the item within the same table. ( I don't want to duplicate the table due to large amount of data). Sometimes the code doesn't have description in this case return blank.
Solved! Go to Solution.
Hi @Saxon202202 ,
For this you need to create an intermidiate step that make a group with the maximum or minimum, but has @andhiii079845 , be carefull with having more than one value for each code, in this case I'm picking up only the minimum.
Then you do a merge of the table with itself and you get the final result.
= Table.NestedJoin(#"Changed Type", {"Code"}, #"Grouped Rows", {"Code"}, "Grouped Rows", JoinKind.LeftOuter)
Complete code below and in attach file.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", Int64.Type}, {"Description", type text}, {"Result(Description)", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Code"}, {{"Description Final", each List.Min([Description]), type nullable text}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Code"}, #"Grouped Rows", {"Code"}, "Grouped Rows", JoinKind.LeftOuter),
#"Expanded Grouped Rows" = Table.ExpandTableColumn(#"Merged Queries", "Grouped Rows", {"Description Final"}, {"Description Final"})
in
#"Expanded Grouped Rows"
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Saxon202202 ,
For this you need to create an intermidiate step that make a group with the maximum or minimum, but has @andhiii079845 , be carefull with having more than one value for each code, in this case I'm picking up only the minimum.
Then you do a merge of the table with itself and you get the final result.
= Table.NestedJoin(#"Changed Type", {"Code"}, #"Grouped Rows", {"Code"}, "Grouped Rows", JoinKind.LeftOuter)
Complete code below and in attach file.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", Int64.Type}, {"Description", type text}, {"Result(Description)", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Code"}, {{"Description Final", each List.Min([Description]), type nullable text}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Code"}, #"Grouped Rows", {"Code"}, "Grouped Rows", JoinKind.LeftOuter),
#"Expanded Grouped Rows" = Table.ExpandTableColumn(#"Merged Queries", "Grouped Rows", {"Description Final"}, {"Description Final"})
in
#"Expanded Grouped Rows"
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThe important point is if the code have everytime the same text if not blank. Not like: 123 apple , 123 appl , 133 appple. i would create a own dimensional table for the lookup values and use than the merge function.
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 81 | |
| 65 | |
| 50 | |
| 45 |