Joseph was faithful during a long spell of "trouble" in his life.
Thanks for your question.
One Bible timeline which I consulted in preparing this answer has Joseph being sold into Egypt about 1897 B.C. and ascending to power in 1884 B.C. According to this timeline he died in 1804 B.C. He was born in 1914 B.C. and so lived 110 years. See Genesis 30:1-50:26. From the time that he was sold into Egypt until he came to power was about 13 years.
I hope this answers your question.