web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Group by and sum

(1) ShareShare
ReportReport
Posted on by 32

Hi,

 

I have a collection with the following fields

FabricCut QtyCut Length
Main5185
Main2181
Main2181
Main3185
Milton4238.5

 

I want to get the unique data considering fabric and cut length. Then sum the Cut Qty.

Output I am trying to achieve.

 

FabricCut QtyCut Length
Main8185
Main4181
Milton4238.5

 

I have searched and am really struggling to grasp the concept. I know what I have below is long, but here is what I tried.

 

 

ClearCollect(combine_fabric,AddColumns(Fabric_Cuts,"Unique_Col",Fabric & Cut_Length));

ClearCollect(combine_fabric2,AddColumns(GroupBy(combine_fabric,"Unique_Col","NameGroup"),"total_cuts",Sum(NameGroup.Cut_Qty,Cut_Qty)));

 

 Any help is greatly appreciated.

Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    Seems like you're trying to group the data by both fabric and cut length, then sum the cut quantity.

    You're sort of on the right track, but your formula can be simplified.

    Here's a way you can achieve it:

    ClearCollect(colGroupedFabric,
     AddColumns(
     GroupBy(Fabric_Cuts, "Fabric", "Cut_Length", "GroupedData"),
     "SumCutQty",
     Sum(GroupedData, Cut_Qty)
     )
    );
    
    ClearCollect(combine_fabric,
     ForAll(colGroupedFabric,
     {
     Fabric: Fabric,
     Cut_Qty: SumCutQty,
     Cut_Length: Cut_Length
     }
     )
    );
    

     

     

    See if it helps @BradLambie 

  • BradLambie Profile Picture
    32 on at

    Thank you so much! Worked flawlessly and makes sense. Its funny how you can stare at something for hours be so lost. Then in 30 seconds its solved by someone else.

     

    Really appreciate it 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard