cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

cumulative calculated column (try addcolum, sum...)

Hello everyone again, how I calculate the sum of each COLUMN in a table, thank you., I need to show the final result of each column example: sales table: juan sells 500, maria 200, pepe 100, accumulated 800, thanks beforehand.

 

can the accumulated be placed on a label or some other way?

 

pregunta-sharepoint 7.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: cumulative calculated column (try addcolum, sum...)

Add a Label

Set it's Text property as Sum ( TableName, ColumnName)

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-aggregates

You may need to filter the formula identically to how the Data Table is being filtered. NOTE: This is not delegable. How many rows do you expect this data table to have, and to be summed up?

 

There are other ways we can do this; this is a simple solution to meet that need.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: cumulative calculated column (try addcolum, sum...)

Add a Label

Set it's Text property as Sum ( TableName, ColumnName)

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-aggregates

You may need to filter the formula identically to how the Data Table is being filtered. NOTE: This is not delegable. How many rows do you expect this data table to have, and to be summed up?

 

There are other ways we can do this; this is a simple solution to meet that need.

View solution in original post

Super User
Super User

Re: cumulative calculated column (try addcolum, sum...)

@MrX19 

Datatables are a very limiting control when compared to say Galleries, at least in my experience. They are really only best at displaying data. However, all of this doesn't really help you out.

 

What you could try is to using the Sum() function with the same code you have on the Items property of your DataTable, eg

Sum(yourSPList, yourColumnName)

This will give you a delegation warning but you can ignore this if your SP List is less than 2000 records.

 

Your could also pull your data into a local collection and this would remove the delegation warning, eg

// add this code to a Button, Screen OnVisible or App OnStart
ClearCollect(colMySumData, yourSPList);

// Adjusted Sum formula
Sum(colMySumData, yourColumnName)

 

You can add the 'Sum(...)' formulas to a Label if that's what you want?

 

If your SP List has more than 2000 records then you will need to investigate different ways to access the records you need/want eg can you just  use Filtered data that only collects <2000 records, etc

 

Let me know if this helps.

Highlighted
Microsoft
Microsoft

Re: cumulative calculated column (try addcolum, sum...)

Hi@MrX19,

 

Based on the issue you mentioned, you want to calculate the sum of each COLUMN in a table.

 

Considering your request, I have a test on my side in which there is a column named “Total” to be calculated.

 

Here is a solution for reference:

 

Add a Label, set the Text property like this:

Sum(Table,Total)

 

Note: “Table” in Sum is my datasource, if you have your table filtered, please modify the above formula as below:

 

Sum(“Type Items property formula of the Data Table here”, ‘Unidades asignadas’)

 

Best Regards,

Qi Qiao

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,840)