How to get currently inserted rows and sum them within Mysql trigger before insert
BEFORE inserting, use OLD.

Is this building something like a "Summary table" for a Data Warehousing application?  If so, consider doing:

INSERT INTO tmp VALUES ...;
INSERT INTO summary_table  SELECT SUM(...),... FROM tmp GROUP BY ...;
INSERT INTO real SELECT * FROM tmp;


There are many variants on that flow.  But note that you get a chance to transform data, do multiple inserts, etc.  And, quite probably the GROUP BY will be faster than doing one the rows one at a time, as you are doing with the TRIGGER.