good afternoon

I want to make the field total "margin" so I used the AccumulativeColumn but my result is coming empty

->pipe(new CalculatedColumn(array(

            "totalMargem"=>function($data){
                if(!empty($data["totalVenda"])){
                    $data["totalMargem"] = (($data["totalVenda"] - $data["totalCusto"])/$data["totalVenda"])*100;

                }
     
                return   $data["totalMargem"];
            }
        )))
        ->pipe(new AccumulativeColumn(array(
            "Total"=>"totalMargem"
        )))

I put an alert to see if the data was passing