I need to auto identfify editprofile button and click on button

Hi Team,

as per below scenario some records dont have buttons based on condtionds,some records having buttons.here i need to click Editprofile button.first i wrote xpath for tr1 after that one more user is crated then its moving to tr2 .so its not located. so am expecting inthat table we need to search for editprofile button wherever its located in that table.if we have mulitple then i need to click on first one always.