Solar is cheaper than coal only when sun shines brightest in the noon, while the peak demand is generally around sunset. Solar energy generation is anywhere from 30-50% of nameplate capacity depending on location. This necessitates, additional solar equivalent capacity installation of peaker plants, or base load plants to cater to sunlight unavailable hours.
Newer storage tech is needed to address the situation like batteries, hydro or concentrated solar etc. Almost all of them are costlier than straight up burning coal or gas now.