so as not to affect the game balance
Obviously ask your DM first, but it's worth noting that Crawford himself says that they literally just don't take damage types into account when designing spells, so changing them shouldn't break anything.
Of course, that's kind absurd, but a slightly more sane take, from the homebrew community, is that damage types are roughly aligned in trios, and you can safely change damage types between the same level or worse without hurting anything.
Those trios being:
bludgeoning/piercing/slashing
cold/fire/poison
acid/lightning/necrotic
force/psychic/radiant
So a cold fireball would be fine, a slashing fireball would be slightly weaker, but a necrotic fireball would be a bit much, and a force fireball is (self-evidently) quite a bit more powerful. I use this myself, to allow casters to be a bit more thematic; at my table, when you learn a spell, you can set it to any equal or lesser damage type and reflavour it however you want. E.g. if someone took fireball, they might say it does piercing damage and flavour it as a blast of needles.