Grouping text by same name

Hello,
I have a new project and I am trying to group consecutive rows with same name together in one row (Names can appear more than once, I don’t want total name group) and concatenate the text (with a space in between in each line). I have tried to use Grouping however it consolidates the names all together.
I have attached a demo file,
Data
image

Result
image

Any suggestions on how to tackle this would be greatly appreciated.
Test Consolidation.pbix (23.4 KB)

Hi @KimC,

For a task like this you can use Group By 's optional 3rd “GroupKind” parameter.
Just create a “Group By” step, select “All Rows” and modify the code in the formula bar.

You can paste this code into a new blank query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lZDNDoJADIRfpdkz7yHGoCbiwRAOFRolLFuyP5F9e1kMWo4ev5l0Jp2qUgVOKlN5p+pshRstUPIww5EF7AEHeJHWQiufaHqIHMDQ5IVxHQTsGNiIjnwO+SRfPDYxFc3X0LmUZMEHazbu735VSnK+M4+/tDN5sksat9Bi3IijJnQEbiTsIYwbr0GzvEga72zRy4VOBznXusG3Ps3jVF2/AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Talk = _t]),
    ChType = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Talk", type text}}),
    Grouped = Table.Group(ChType, {"Name"}, {{"Talk", each Text.Combine([Talk], " "), type nullable text}}, GroupKind.Local)
in
    Grouped

I hope this is helpful

7 Likes

@Melissa that optional parameter is gold. Thank you very much

1 Like