Different case and display value depend on case

float power=val*240;

Makes no sense at all because the result of an analogue read is a number between 0 and 1023, it is not a voltage. Turn the reading into a voltage by multiplying it by 5/1024

The value energy will increase every minute

Then the bit of code that says

energy=(power/3600)+energy;

Is a noncense because there is nothing restricting how often you take the samples.

Please post compleat code in code tags if you want to continue to get help here.