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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 51 | |
| 41 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 124 | |
| 108 | |
| 47 | |
| 28 | |
| 27 |