24 - Group by and Text Combine in Power Query

preview_player
Показать описание
(Sorry about the loud microphone, I wanted to play with the settings to avoid hearing the birds outside)

How to use the Text.Combine function - which normally takes values from different columns and combines them - while grouping rows.
In this example I want to have one row per month I had sales. I want a column with all the names of my salespeople that made a sale in the given month.
I also show how to chain this function with the Table.Distinct function to remove duplicate results.

I don't show it, but if you had more columns (e.g. sale value), you could use the Max function to return a filtered table, where you have one row per salesperson AND you only keep the row with the highest sale value, in case they have multiple sales that month.

I forgot to show how you can use other delimiters.
You can do a normal Text.Combine with the GUI-button to see your options, and copy the code.
If you want a newline character, you'd replace ", " in the function with "#(lf)" which stands for "line feed".

00:00 - Intro
00:00 - Group by and Text.Combine
05:53 - Text.Combine on a Table-column
08:24 - No duplicates
08:40 - Table.Distinct doesn't working on a Table-column
09:00 - Table.Distinct
11:41 - One last explanation of Text.Combine with Table.Distinct
13:04 - Might want to sort your table first
13:29 - Sorting a Table-column (success!)
14:04 - Sorting a Table-column (failure!)
15:24 - Sorting a Table-column (success!)
Рекомендации по теме
Комментарии
Автор

Bro, I love you so much, liked and subscribed

bundol