That’s because you did not format your original post correctly and the quotes were ‘fancy’ single quotes and @Holdestmade copied them. Also you need to cast the attribute as floating point before performing the multiplication. Also is your attribute really overview.lastYearData.energy ?
I’ve used it but you might want to check that.
states.sensor.entity.attributes.attribute is identical to state_attr('sensor.entity', 'attribute') except the second version will return the value of the attribute or None if it doesn’t exist. If it’s not working it might be because your attribute is badly named. It should not contain capitals or decimal points.
Can you paste a screenshot of sensor.solaredge_overview as it appears in the States page? I’m curious to see how it displays an attribute like overview.lastYeardata.energy.