Calculate new percentage when new record is added
Why don't you sum the result for each group and use that sum to calculate the overall percentage?
E.g. You have 4 groups with result 34,23,56,78. The total percent can be calculated by:
 total = sum(34,23,56,78)/4 * 100;

After running the aforementioned php code on insertion, use the value of the $result variable to perform the calculation.

Wanted to put as a comment but I can't... I will try to put the above in code. Does this help?

This is a sample:

$conn = mysqli_connect("localhost","root","","test"); # replace the details as it becomes necessary
if(!$conn){
die("Connection failed: " . mysqli_connect_error());
}
else{
    $initRows = 0;
    $result = 0;
    $sql = "SELECT SUM(num1 + num2 + num3) AS SumNumbers  FROM numbers GROUP BY numid";
    $res = $conn-&gt;query($sql);
    $initRows = 0;
    $rowNum = 0;
    $result = 0;
    $total = 0;
    if ($res-&gt;num_rows &gt; 0) {
       while ($row = $res-&gt;fetch_assoc())
        {
            $initRows = $row['SumNumbers'];
            $rowNum = $res-&gt;num_rows;     #this will give the number of rows
            $columncount = mysqli_num_fields($res); # this will give the total number of columns
            $result = floor(($initRows/$columncount)*100); #this will give the percentage 
            $total += $result;     #this will give a total of all results but not the percentage. if you need the persentage of the total, you can now derive it using the $total variable
            echo $result ." &lt;br /&gt;";
        }
        echo "Total is " . $total . " &lt;br/&gt;";
        $totalres = floor(($total/$rowNum)*100);
        echo "Total result percentage is " . $totalres;
    }
}