You don't need an automation for that.
In your "Sales" table, you need to create a linked record field called "Category". That field needs to be linked to a brand new table that you create called "Categories".
Then, in your "Categories" table, Airtable will automatically create a new linked record field for you there that links back to your "Sales" table. Leave that field alone.
Next, in your "Categories" table, you would create a Rollup field based on the linked record field, and choose your "Total" field from the "Sales" Table. For the rollup formula, type in: SUM(values)
Then, you will have the Total for each category.
Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld