Forum Discussion
Anonymous
2 years agoNot applicable
Lookup and Concatenate
Hello, I'm new to Power BI and looking for a solution for my scenario below: I have a SharePoint field that has multiple values in one column. This is in the form of an ID. I call this Table A ...
- 2 years ago
Anonymous
vicky_ 's solution is great. Just add another solution for the last step.
you can group by in the PQ
= Table.Group(#"Expanded Table B", {"Index"}, {{"id", each Text.Combine([User_ID],","), type nullable text}, {"name", each Text.Combine([Name],","), type nullable text}})
then delete the index column
pls see the attachment below
- 2 years ago
Hi,
This M code works
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"User_ID", type text}}), Custom1 = Table.ToRows(Table2), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.ReplaceMatchingItems(Text.Split([User_ID],", "),Custom1),", ")), #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"User_ID"}) in #"Removed Columns"Hope this helps.
Anonymous
2 years agoNot applicable
Thank you for the prompt response. I will try both options.