Question: I want to add a table to the layout in QGIS. I am interested in using attribute table. But, no summarize information from the attribute.

Can we add a row from attibute in the layout?

The row is the total (sum) from first row until end row.

My plan is creating maps with atlas. I successful to show dynamic table from adding attribute table. But, the weakness is no total (sum) from attribute table.

Update :

The relation is like this. One layer is boundary of village. The others are area of green space block.

[![table example](https://i.stack.imgur.com/Npd44.png)](https://i.stack.imgur.com/Npd44.png)

[![relation](https://i.stack.imgur.com/zuJpR.png)](https://i.stack.imgur.com/zuJpR.png)

[![result](https://i.stack.imgur.com/7ROLS.png)](https://i.stack.imgur.com/7ROLS.png)

Answer: 
For the total column I suggest to use labels with expressions:

first version
-------------

using labels:

[![enter image description here](https://i.stack.imgur.com/8gYjv.png)](https://i.stack.imgur.com/8gYjv.png)

In this project I have two layers in relation 1: m,
to calculate the sum of the areas or perimeter of the child features, I used this expression inside the label:

```
format_number( relation_aggregate( 
 relation:='rel',
 aggregate:='sum',
 expression:="shape_area"),2)

```

[![enter image description here](https://i.stack.imgur.com/hhM3n.gif)](https://i.stack.imgur.com/hhM3n.gif)

second version
--------------

using the '[add fixed table](https://docs.qgis.org/3.22/en/docs/user_manual/print_composer/composer_items/composer_tables.html?highlight=add%20fixed%20table#the-fixed-table-item)'

add a table and populate the fields by expression:

```
format_number( relation_aggregate( 
 relation:='rel',
 aggregate:='sum',
 expression:="shape_area"),2)

```

[![enter image description here](https://i.stack.imgur.com/nXPXA.png)](https://i.stack.imgur.com/nXPXA.png)
Version 1: create a new column in the layout
--------------------------------------------

In the layout, go to the attribute table's `Item Properties` and click `Attributes...`. Add a new attribute by clicking the green `+` icon and add one of the expressions from below to create the sum you want:

[![enter image description here](https://i.stack.imgur.com/xgEZB.png)](https://i.stack.imgur.com/xgEZB.png)

To calculate the sum you like, you have different options. Use one of the following expressions:

* Just add the fields you want to sum: `field1 + field2 + field3 + field5 .... + fieldn`
* If you want to create the sum of **all** attribute field, use the expression `array_sum(map_avals(attributes ()))`.
* To create the sum of **all expect some** of the attribute fields, use this expression. At the end of line 3, there is a comma-delimited list of the fields you want to **exclude** from the sum - so this example here creates the sum of all fields **but** `field1` and `field2`:

```
 array_sum (
     array_foreach (
         array_filter(map_akeys( attributes ()), @element not in ('field1' , 'field2')),
         map_get (attributes (), @element)
 ))

```

Version 2: create a new field in the attribute table
----------------------------------------------------

You can add a new field in the attribute table in QGIS main window. Use [field calculator](https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/attribute_table.html#using-the-field-calculator) to create the field and an appropriate expression to create the sum you like (same expressions as above).