Solar panels only produce when sun is up, oil generators are expensive to run, nuclear plant can't adapt their production, ... Each primary energy has its own characteristics, you must mix them to find the better balance.
Managing an electric grid is hard. Electricity is hard to store, consumption vary between consumption peaks and low demands periods. Adapt yourself and manage your grid with information you get from the production / consumption chart.
Some buildings need resources (oil, coal, ...) to run. You must buy them at best price, and build infrastructure to store them.