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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Collapsing 2 rows in to 1

Hi everyone,

 

I have a query with 2 rows per ID; one row with a value in the Pillar column and one row with a value in the Deliverable column. I would like to collapse both rows in to one but have not been able to figure out how to do it with grouping. 

 

Kudos to anyone who can assist.

 

bchager6_0-1668111935139.png

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

This is the standard GroupBy functionality in PBI:

 

jbwtp_0-1668118859742.png

 

Regards,

John

View solution in original post

4 REPLIES 4
jbwtp
Memorable Member
Memorable Member

Hi @Anonymous,

 

In the most simplistic way (assuming you do not mind hardcoding the column names):

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUQIiQwt9A0t9IwMjI6VYHYiokRFcCKgEJOoEUmiATRSk3BTFBGeQkIE+UDmyWmeoWjO4BEjUBWSuMbq5LhC1FgilsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [USER_ID = _t, CREATION_DATE = _t, ADMINISTERED_DATE = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"USER_ID", type text}, {"CREATION_DATE", type date}, {"ADMINISTERED_DATE", type date}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"USER_ID"}, {{"CREATION_DATE", each List.Max(_[CREATION_DATE])}, {"ADMINISTERED_DATE", each List.Max(_[ADMINISTERED_DATE])}})
in
    #"Grouped Rows"

 

 

Cheers,

John

Anonymous
Not applicable

@jbwtp Thank you. How did you produce that code?

Hi @Anonymous,

 

This is the standard GroupBy functionality in PBI:

 

jbwtp_0-1668118859742.png

 

Regards,

John

Anonymous
Not applicable

@jbwtpThank you!

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.

Top Kudoed Authors