Greece is heading to a national election next month after Prime Minister Alexis Tsipras faced an unexpected loss in recent European Parliament elections.