Energy is defined as ability to do work.
Mathematically,
Energy = Work.
Dimensional formula of Work = M1L2T-2 [Check how Dimensional Formula of work is derived]
Putting these values in above equation we get,
Dimensional Formula of Energy = M1L2T-2
SI unit of Energy is Joule (J)