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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Pete_Murphy_71
Regular Visitor

Simple question, How to summarize rows

Hi, I have what should be a simple issue but I just can't seem to sort this one out (perhaps I need more coffee 🤣)

 

I have two columns, in my example data first a city and second a comment about it.

I want to summarize every city in a single row and list all the comments out along that row. I have been playing around with pivot, unpivot, transpose but just can't seem to get it. I am pretty sure I am just having a tough day of it and missing something simple, so decided to ask the community for help!!!

 

Here is an example of what I have...

Place           Description

New YorkLoved it
New YorkNice
New YorkFantastic place
PheonixBrilliant
Los AngelesHad a great time
Los AngelesGreat People
San DiegoJust Wow

 

Here is what I am after

Place            Description01   Description02   Description03

New YorkLoved itNiceFantastic place
PheonixBrilliant  
Los AngelesHad a great timeGreat People 
San DiegoJust Wow  

 

So each city appears just once but all the descriptions are listed out through the row....

Anyone out there able to help me out???

 

 

Screenshot 2022-12-21 113553.jpg

 

 

1 ACCEPTED SOLUTION
Luxtra
New Member

It depends a little, on what you want to achieve. Do you want to model the Data in PowerQuery to match this structure? Then try Grouping:

 

 

let
    Source = "Your Source!",
    #"Group" = Table.Group(Source, {"Place"}, {{"Description", each Text.Combine([Description],";")}}),
    #"Split Column" = Table.SplitColumn(#"Group", "Description", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Description.1", "Description.2", "Description.3"})
in
    #"Split Column"

 

 

Edit: this will be the output in Table View:

Luxtra_1-1671621450005.png

 

If it is merely a Question of Visual representation try a Matrix and add both Data Fields to the "Row" Section.

Luxtra_0-1671621313656.png

 

 

View solution in original post

4 REPLIES 4
Luxtra
New Member

It depends a little, on what you want to achieve. Do you want to model the Data in PowerQuery to match this structure? Then try Grouping:

 

 

let
    Source = "Your Source!",
    #"Group" = Table.Group(Source, {"Place"}, {{"Description", each Text.Combine([Description],";")}}),
    #"Split Column" = Table.SplitColumn(#"Group", "Description", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Description.1", "Description.2", "Description.3"})
in
    #"Split Column"

 

 

Edit: this will be the output in Table View:

Luxtra_1-1671621450005.png

 

If it is merely a Question of Visual representation try a Matrix and add both Data Fields to the "Row" Section.

Luxtra_0-1671621313656.png

 

 

Thank you for taking the time to help me. I appreciate your help.

It looks like I needed to do this solution using M code as part of the GroupBy function. In particular

 

Text.Combine([Description],";")

 

I could not work out how to do this from the GroupBy button. 

 

Again, thank you for taking your time to help me.

Anonymous
Not applicable

Use a matrix instead of a table. City as rows, description as values.

Thanks, I really appreciate your help, but unfortunately it didn't work. I put City as Rows and Description of Values but it only gave the first description. Here is what happened.

Screenshot 2022-12-21 115954.jpg

 

It is missing the other descriptions..... This seems to be a tougher question than I originally thought..

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.