# Power table sum column and display

**URL:** <https://forum.inductiveautomation.com/t/power-table-sum-column-and-display/38904>\
**Category:** Ignition\
**Tags:** vision, database, ignition80\
**Created:** [September 21, 2020, 8:09pm UTC](https://forum.inductiveautomation.com/t/power-table-sum-column-and-display/38904 "2020-09-21T20:09:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 21, 2020, 8:09pm UTC](https://forum.inductiveautomation.com/t/power-table-sum-column-and-display/38904/1 "2020-09-21T20:09:39Z")

</div>

v8.0.16 vision  
I have a power table with a column for cost. I want to sum up the rows and display the total cost for all rows. What is the best way to display this, just plop under the corresponding column and setup up layout accordingly and hope it will line up? I kind of want this to look like a report where you can add a total line.  
Any tips from the pros on this?

---

<div class="post-metadata">

**Author:** ![Devin](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@Devin](https://forum.inductiveautomation.com/u/Devin)\
**Post date:** [December 28, 2020, 4:57pm UTC](https://forum.inductiveautomation.com/t/power-table-sum-column-and-display/38904/2 "2020-12-28T16:57:11Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [December 28, 2020, 7:06pm UTC](https://forum.inductiveautomation.com/t/power-table-sum-column-and-display/38904/3 "2020-12-28T19:06:02Z")

</div>

If you want the sum to be a part of the table, you’ll have to add a row that contains the same column count and types. I would put a custom property on the table named `rawData` and put your binding on that. Then add a `propertyChange` script on the table that does something like the following. This assumes you have 2 columns, the first is of type string and the second is the one you want to sum.

```auto
if event.propertyName == 'rawData':
	sum = 0
	for row in range(event.source.rawData.rowCount):
		sum += event.source.rawData.getValueAt(row, 1) 
	summaryRow = ['Sum', sum]
	
	event.source.data = system.dataset.addRow(event.source.rawData, summaryRow)

```
