cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Facing challenge with GroupBy formula.. Help!!!

Hi Experts,

 

I am pretty new to powerapps. I am trying to create a basic application using sharepoint lis.

I am facing issue to implement following formula.

i have two tables.

Table1 {ID,Region,Subregion,Agent,ProjectID}

Table2 {ProjectID,ActionDate,AmountSpent}

 

I need to show Region, Subregion, Agent, ProjectID, TotalAmountSpent on a list form.

I am using following formula but it is not giving me blank rows.

LookUp(AddColumns(
GroupBy('Table2',"ProjectID","Group1"),
"SumOfSpentAmount",
Sum("Group1","AmountSpent")),ProjectID=ThisItem.ProjectID).SumOfSpentAmount

 

Please help me to find the issue.

 

Thanks,

Arup

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Facing challenge with GroupBy formula.. Help!!!

You're looking for an expression similar to the one below:

AddColumns(
    Table1,
    "SumOfSpentAmount",
    LookUp(
        AddColumns(
            GroupBy(Table2, "ProjectID", "ByProject"),
            "SumOfSpentAmount",
            Sum(ByProject, AmountSpent)),
        ProjectID = Table1[@ProjectID],
        SumOfSpentAmount))

This will give you a new table with the column 'SumOfSpentAmount' whose value comes from the grouping / sum that is done on the second table.

View solution in original post

2 REPLIES 2
Highlighted
Power Apps
Power Apps

Re: Facing challenge with GroupBy formula.. Help!!!

You're looking for an expression similar to the one below:

AddColumns(
    Table1,
    "SumOfSpentAmount",
    LookUp(
        AddColumns(
            GroupBy(Table2, "ProjectID", "ByProject"),
            "SumOfSpentAmount",
            Sum(ByProject, AmountSpent)),
        ProjectID = Table1[@ProjectID],
        SumOfSpentAmount))

This will give you a new table with the column 'SumOfSpentAmount' whose value comes from the grouping / sum that is done on the second table.

View solution in original post

Highlighted
New Member

Re: Facing challenge with GroupBy formula.. Help!!!

Hi Carlos,

 

Thanks for your reply.

I understand the issue in my formula. I was passing GroupName and Fieldname as string into Sum formula.

I removed "" marks and now it is working fine.

 

Thanks,

Arup

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,927)