cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MrX19
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
GarethPrisk
Super User II
Super User II

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
GarethPrisk
Super User II
Super User II

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

Eelman
Super User
Super User

@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.

v-qiaqi-msft
Community Support
Community Support

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (39,485)