Please remember this is not financial advice and just from my experience over the last few years on MCP.

REMEMBER: In order to build and also run a Energy building (or any), you will need LAND and also CITIZENS. The number of citizens you need increases with each upgraded level. Please check the official guide for the exact numbers. The below chart is also shown in the official guide and is for an Energy building. The amount of materials required changes for each type of building.

You just need to total up the number of materials you need.. then use the Vault to work out the amount of MEGA you will need to exchange. You will also need to know the fees for every level of upgrade.