Of course it can. Too high or low e2 can effect ones libido/erectile function.
There are also many other factors aside from e2 that can effect libido negatively such as lack of quality sleep (REM)/excess stress (mental/physical)/neurotransmitter health (dopamine plays strong role in libido)/high prolactin/depression and anxiety.............you get the picture.
Libido is complex and you need to look at the overall picture and try to eliminate possible causes.