cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shahin1
Helper I
Helper I

Sum of two columns in third column

In a list I have two columns, I want patch the sum of two columns into third column. Please help me with formula.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Shahin1 ,

Something like

ForAll(
   YourDataSourceName As aPatch,
   Patch(
      YourDataSourceName,
      {ID:aPatch.ID},
      {ThirdColumn:aPatch.FirstColumn + aPatch.SecondColumn}
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

7 REPLIES 7
PG_WorXz10
Resident Rockstar
Resident Rockstar

@Shahin1 

 

Would you please explain more on this like if you want the sum to be calculated in a gallery item wise or you want to patch the value ? 

Below formula is for Sum you can add the variable based on the above requirement.

 

Sum(Value 1,Value 2)

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Shahin1
Helper I
Helper I

Hi I have a list with ListName and Column1, Column2 and Column3.

I am patching column1 : countrows(....)

Column2 : countrows(some big calculation...)

Now I want Column3 result as clomun2+column1,

If I try to patch as

Column3: Sum(Column2,Column1).

It's throwing error.

I tried add columns still it's showing some syntax error.

I am trying for formula with correct syntax.

 

 

 

 

 

@Shahin1 

 

Did you tried instead of columns and countrow calculation of both the columns ? 

Eg: Sum (countrow(column1),countrows(column2)) 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

WarrenBelz
Super User
Super User

Hi @Shahin1 ,

Something like

ForAll(
   YourDataSourceName As aPatch,
   Patch(
      YourDataSourceName,
      {ID:aPatch.ID},
      {ThirdColumn:aPatch.FirstColumn + aPatch.SecondColumn}
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

It is throwing error like"This function cannot operate on the same datasource that is used in ForAll"

Hi @Shahin1 ,

 

Did you tried passing the countrow values directly in Sum function ?

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

@Shahin1 ,

Yes - I had not tested that - try

With(
   {wList:YourDataSourceName},
   ForAll(
      wList As aPatch,
      Patch(
         YourDataSourceName,
         {ID:aPatch.ID},
         {ThirdColumn:aPatch.FirstColumn + aPatch.SecondColumn}
      )
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,434)