Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Simple concatenation of values in column 2, to a row for each value in column 1

Hi,

 

I feel like this should be really easy but can't for the life of me work out how to do it 😕 (have tried various pivoting/unpivoting type options but can't get anything to work. Thank you in advance!

 

Capture.PNG

 

1 ACCEPTED SOLUTION
Einomi
Helper V
Helper V

Use the following code

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    ChangedType = Table.TransformColumnTypes(Source,{{"Item", type text}, {"Label", type text}}),
    GroupBy = Table.Group(ChangedType, {"Item"}, {{"Labels", each Text.Combine([Label],", "), type nullable text}})
in
    GroupBy

 

If this answers your question, please accept it as a solution, and we welcome Kudos 🙂

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Ok - thank you for replying and thanks again for your help, greatly appreciated!

Einomi
Helper V
Helper V

Use the following code

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    ChangedType = Table.TransformColumnTypes(Source,{{"Item", type text}, {"Label", type text}}),
    GroupBy = Table.Group(ChangedType, {"Item"}, {{"Labels", each Text.Combine([Label],", "), type nullable text}})
in
    GroupBy

 

If this answers your question, please accept it as a solution, and we welcome Kudos 🙂

Anonymous
Not applicable

Thank you that works perfectly - solution accepted!

 

Was there a way to do that via the menu (i.e. without knowing the code itself?), feels like it would be a fairly common use case!

Unfortunately there is no option in the user interface, you have to Group By then tweak the M code, we can also have the list sorted in ascending order if you wish

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.