This article shows, how to merge text strings into groups. Like CONCATENATEX, but in queries – not in DAX.

In another words we are going to create the right table from the left one:

In Power Query you can´t do it by one click, but you can write it in the Power Query M Language:

  • = Table.Group(#”Change type”, {“Brand“}, {{“List of models”, each Text.Combine([Model],”, “), type text}})

Just replace the red parts with your name of previous step and names of your columns:

The sample file can be downloaded here:

If you are not fans of direct coding in M, you can start by clicking and then tune it little bit. Start by grouping and use any function, for example SUM (it will make sense later…):

Ten go to formula bar and simply rewrite sum to Text.Combine and it works. If you want to separate the result strings, just add the second argument of Text.Combine:

1 Comment

  1. Congratulations! Here was the only place I could find the solution.

Leave a Reply

Your email address will not be published.

*

clear formPost comment