It's life Joseph's story is a story inside a story. Judah get's one chapter in Genesis and it is said that he happened to go down and down he went. Marries a Cannanite woman and has 3 pretty pathetic sons and even eventually gets his daughter in law pregnant! Nice going Judah.
But then in steps in Joseph, second youngest and son of Jacobs loved wife Rachel. The story of Joseph though is about how God is using the messed up people to accomplish he purpose. A story of how he is using broken humanity to bring about his ultimate salvation. Joseph doesn' happen to go down, the very next chapter in Genesis tells us that he was "brought down" chapter 39. Brought down to Egypt a place of sin and slavery. Joseph comes unto his own and his own reject him, "kill" him off and he ends up in a foreign land. God is with him though and he goes from bad to worse, a slave, a prisoner innocently blamed. But,... God was with him and his pure life of God honoring devotion ends him at the right hand of the king and in a position to bring salvation to all the nations!

But he lived his life as a picture of one who would come in the line of Judah and that's why Jacob gives his blessing to Judah at the end of his life, a blessing that describes
what we have just read of Joseph's life, like Joseph's life was mean to be a picture to us of the one who would come, Jesus!