Tunable anomalous Hall conductivity through volume-wise magnetic competition in a topological kagome magnet