To make a table in Word perform some automatic summation of values there are formatting steps you have to take. Below is an example of what you might want the final result to look like.
The shaded values in the image below are created from formula fields. In order for the "=SUM(ABOVE)" formula to work in the Subtotal rows, there must be a blank row or a non-numeric cell between the parts of the table. The red arrows point to the inserted blank rows. I have made them very narrow so they look like just a line separator, but in fact they are actually a blank row.
In order to calculate the Grand Total, which is a sum of the two Subtotals, each Subtotal formula is enclosed within a bookmark. For this example they are named Materials and Services.
The field formulas are shown in the image below. They include the code needed for formatting.
To update the table after adding new data rows, you select the table and then press F9.