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
djoellet
Frequent Visitor

Grouping Rows

Please see the sample data below (current state).  I am trying to group rows by the account number, select the project mgr and city associated with the lowest project#, and sum the revenue and hours worked.  I don't have to list all the project #'s but if that is easily done that would be a bonus.  I also wanted to note that there could be as many as 75 project #'s associated with any account number.  Any assistance would be greatly appreciated.  Thank you!!

 

Capture.png

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

=Table.Group(PreviousStepName,"Account #",{{"Project #",each Text.Combine(List.Transform([#"Project #"],Text.From),",")},{"Project Mgr.",each Table.Sort(_,"Project #")[#"Project Mgr."]{0}},{"City",each Table.Sort(_,"Project #")["City"]{0}},{"Rev",each List.Sum([Rev])},{"Hours Billed",each List.Sum([Hours Billed])}})

View solution in original post

2 REPLIES 2
djoellet
Frequent Visitor

Thank you! This worked perfectly.

wdx223_Daniel
Community Champion
Community Champion

=Table.Group(PreviousStepName,"Account #",{{"Project #",each Text.Combine(List.Transform([#"Project #"],Text.From),",")},{"Project Mgr.",each Table.Sort(_,"Project #")[#"Project Mgr."]{0}},{"City",each Table.Sort(_,"Project #")["City"]{0}},{"Rev",each List.Sum([Rev])},{"Hours Billed",each List.Sum([Hours Billed])}})

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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 Solution Authors