[(Numbers 7:48:) ON THE SEVENTH DAY, THE PRINCE OF THE CHILDREN OF EPHRAIM. Rabbi Joshua of Sikhnin said in the name of Rabbi Levi:] This is what Scripture says (Ecclesiastes 8:4-5): WHERE THE WORD OF A KING IS, THERE IS POWER, etc.; WHOEVER KEEPS A COMMANDMENT SHALL KNOW NO EVIL THING. And likewise it says (II Samuel 23:3): THE GOD OF ISRAEL SPOKE, THE ROCK OF ISRAEL SAID TO ME: ONE WHO RULES OVER MAN, RIGHTEOUS, RULING IN THE FEAR OF GOD. Who is this? This is the one who rules over his impulse (yetzer). And who was this? This was Joseph, the father of [Ephraim], the father of the father of Joshua son of Nun. What is written concerning him? AND IT CAME TO PASS AFTER THESE THINGS THAT HIS MASTER'S WIFE LIFTED UP HER EYES TO JOSEPH [etc.], BUT HE REFUSED, etc. (Genesis 39:7-8). The Holy One, blessed be He, said to him: You did not listen to her; by your life, I will make you king over Egypt, and all shall be obedient to you, as it is said (Genesis 41:55): AND PHARAOH SAID TO ALL EGYPT: GO TO JOSEPH. And it says (Genesis 41:40): YOU SHALL BE OVER MY HOUSE — and the children of my palace shall do nothing apart from your knowledge. And it says (Genesis 42:6): AND JOSEPH WAS THE RULER OVER THE LAND. Because he ruled over his impulse, he was made ruler over the land. (Genesis 39:2:) AND HE WAS A SUCCESSFUL MAN (ish matzliach). It need only have said "a righteous man." Why is it written "a successful man"? The Holy One, blessed be He, said to him: You attained what Adam the first man did not attain. "Successful" (matzliach) means nothing other than attainment, as it is said (II Samuel 19:18): AND THEY CROSSED OVER (tzalchu) THE JORDAN BEFORE THE KING. The Holy One, blessed be He, said to him: An individual's offering does not override the Sabbath; by your life, your son's offering shall override the Sabbath, on account of the commandment that you fulfilled. Hence (Numbers 7:48): ON THE SEVENTH DAY, THE PRINCE OF THE CHILDREN OF EPHRAIM, ELISHAMA SON OF AMMIHUD. Rabbi Azariah said: The Holy One, blessed be He, said to Joseph: You kept the commandment YOU SHALL NOT COMMIT ADULTERY, and you fulfilled the Torah before I gave it; no tribe shall come between your two sons — rather, Ephraim on the seventh day and Manasseh on the eighth day.
Joseph Who Ruled His Yetzer Becomes Ruler Over Egypt
Midrash Tanchuma Buber, Nasso 32:1
[ביום השביעי נשיא לבני אפרים. אמר ר' יהושע דסכנין בשם ר' לוי] זש"ה (כאשר) [באשר] דבר מלך שלטון וגו' שומר מצוה לא ידע דבר רע (קהלת ח ד ה), וכן הוא אומר אמרק אלהי ישראל לי דבר צור ישראל מושל באדם צדיק מושל (ביראת) [יראת] אלהים (ש"ב כג ג), מי הוא זה, זה שמושל ביצרו, ומי היה זה, זה יוסף אבי (מנשה) [אפרים], אבי אביו של יהושע בן נון, מה כתיב בו, ויהי אחר הדברים האלה ותשא אשת אדוניו את עיניה אל יוסף [וגו'] וימאן וגו' (בראשית לט ז ח), אמר לו הקב"ה, אתה לא שמעת לה, חייך אני ממליכך על מצרים, ויהיו הכל נשמעים לך, שנאמר ויאמר פרעה (אל כל) [לכל] מצרים לכו אל יוסף (שם מ אנה), ואומר אתה תהיה על ביתי (שם שם מ), ולא יעשו בני פלטירין שלי דבר חוץ מדעך, ואומר ויוסף הוא השליט על הארץ (שם מב ו), על ששלט ביצרו נעשה שליט בארץ. ויהי איש מצליח (בראשית לט ב), לא היה צריך לומר אלא איש צדיק, למה כתב איש מצליח, א"ל הקב"ה שוית אתה מה שלא שוה אדם הראשון, אין מצליח אלא שוייה, שנאמר וצלחו הירדן לפני המלך (ש"ב יט יח), א"ל הקב"ה אין קרבן יחיד דוחה את השבת, חייך שקרבן בנך דוחה את השבת, בשביל מצוה שעשית, הוי ביום השביעי נשיא לבני אפרים אלישמע בן עמיהוד. אמר ר' עזריה א"ל הקב"ה ליוסף אתה שמרת מצות לא תנאף וקיימת התורה קודם שנתתיה, אין שבט מפסיק בין שני בניך, אלא אפרים ביום השביעי ומנשה ביום השמיני.