Forum Discussion
Alicia83B
4 years agoHelper I
Add Column based on VLOOKUP and CONCATENTATION
I am looking to add a new column based on looking up an opportunity number and concatentating the products from another column. A comma would be used to separate each Product Code. Here is an ex...
- Anonymous4 years ago
Hi Alicia,
Think this might give you the desired result (just check the column names first):
= Table.Group(#"Renamed Columns", {"Opportunity"}, {{"Count", each Table.RowCount(_), type number},{"ProductCode", each Text.Combine([ProductCode],","), type text}})
Einomi
4 years agoHelper V
Hi,
Please try the following M code
let
Source = Excel.CurrentWorkbook(){[Name="Tableau1"]}[Content],
#"Type modifié" = Table.TransformColumnTypes(Source,{{"Opportunity #", Int64.Type}, {"Product Code", type text}}),
Sort = Table.Group(#"Type modifié", {"Opportunity #"}, { {"New", each Text.Combine([Product Code],", "), type number}})
in
Sort
Please not your column Product Code needs to be formatted as text before applyting this code