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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jcastr02
Post Prodigy
Post Prodigy

grouping by ID

hello please see the attachment current versus the expected result.  How can I achieve this in Power Query within Power BI.  Note that the column PR&A Leader.title
 is a people picker columns

I tried to group by ID and get all rows as aggregate but stuck from there..


Current Expected
IDPR&A Leader.title IDPR&A Leader.title
1  1 
3Grant, Chandle 3Grant, Chandle
4  4 
5Goodrum, Kali 5Goodrum, Kali
6Goodrum, Kali 6Goodrum, Kali; Grant, Chandle
6Grant, Chandle 7Grant, Chandle
7Grant, Chandle   
5 REPLIES 5
v-pgoloju
Community Support
Community Support

Hi @jcastr02,

 

Just a gentle reminder — has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.

This not only closes the loop on your query but also helps others in the community solve similar issues faster.

Thank you for your time and feedback!

 

Best,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @jcastr02,

 

We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.

If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution — it helps others who might face a similar issue.

 

Warm regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @jcastr02,

Just following up to check if the solution shared by our Super User helped resolve your issue. If you're still facing difficulties or need further assistance, please let us know — we’re here to help!

If the response addressed your query, we kindly request you to mark it as Accepted Solution and click Yes if you found it helpful. This supports others in the community as well.

 

Best regards,

Prasanna Kumar

Ashish_Mathur
Super User
Super User

Hi,

This M code works

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"ID"}, {{"Count", each Text.Combine([#"PR&A Leader.title"],","), type nullable text}})
in
    #"Grouped Rows"

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

@jcastr02 start a new blank query, click advanced editor and paste this code, follow these steps on real data.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUVJQitWJVjIGstyLEvNKdBScMxLzUnJSwcImcAWmIAX5+SlFpbk6Ct6JOZlgUTPcopiGmWMRjgUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"PR&A Leader.title" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"PR&A Leader.title", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"All", each _, type table [ID=nullable number, #"PR&A Leader.title"=nullable text]}}),
    #"Added PR&A Leader.title" = Table.AddColumn(#"Grouped Rows", "PR&A Leader.title", each Lines.ToText([All][#"PR&A Leader.title"],if Table.RowCount([All]) > 1 then ";" else ""), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Added PR&A Leader.title",{"All"})
in
    #"Removed Columns"

 

output:

 

parry2k_0-1741982847381.png

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.