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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors