Most of the parasha is about Yosef, but in the middle is a story about Yehuda. Why does this story appear as an interruption in the middle of the Yosef stories? 

The story of Yehuda in Tamar serves as a turning point for Yehuda’s role in the Yosef stories. The major element that changes in the stories of Yosef and his brothers is Yehuda. Tamar is a crucial catalyst for Yehuda’s transformation.