When to do an endometrial biopsy

A patient continues to have breakthrough bleeding while taking oral contraceptives, despite changing pills. What could be the cause?