ספר הזהר, Miketz Miketz · ג
Zohar 177
א
"And it came to pass in the morning that his spirit was troubled (Heb. וַתִּפָּעֶם)." What does וַתִּפָּעֶם mean? Rabbi Yosi said, It has already been explained. Of Pharaoh, it is written, וַתִּפָּעֶם, and of Nebuchadnezzar, it is written, "his spirit was troubled (Heb. וַתִּתְפָּעֶם)" (Daniel 2:1). Pharaoh is described as vatipaem because he comprehended the dream but not its interpretation. Nebuchadnezzar, on the other hand, saw the dream and its interpretation, but forgot everything. It is therefore written vatitpaem (with an extra Tet).
ב
But come and behold, "and his spirit was troubled (Heb. וַתִּפָּעֶם)" corresponds to "And the spirit of Hashem began to move him (Heb. לְפַעֲמוֹ)" (Judges 13:25), for the spirit would appear and disappear, come and go, yet not settle upon him properly. It is therefore written, "And the spirit of Hashem began to move him," when (the spirit) just began (to inspire him). Here also the spirit would appear and leave, then appear, but would not settle upon him, so that he could understand. Of Nebuchadnezzar it is written, "and his spirit was troubled (Heb. וַתִּתְפָּעֶם)," for the inspiration was twice as strong. It would come and go, as it is written, "as on previous occasions (Heb. כְּפַעַם בְּפַעַם, lit. 'as time to time')" (I Shmuel 3:10), now upon this and now upon that, but his mind was not settled.
ג
"And he sent and called for all the magicians of Egypt," refers to the sorcerers; "and all her wise men" refers to the astrologers. They all tried to understand, but could not.
ד
Rabbi Yitzchak said, Although we have learned that a man is shown only what is appropriate to his grade, this is not true for kings. They are shown supernal things that are different from those that other people are shown. Because a king is of a superior grade than other men, that which he is shown is of a higher grade than the rest, as it is written, "what the Elohim are about to do He has declared to Pharaoh" (Beresheet 41:25). But to other men, the Holy One, blessed be He, does not reveal His works. He reveals them only to the prophets, the pious, and the wise men of the ages, as has already been explained.
ה
Come and behold, It is written, "me he restored to my office, and him he hanged" (Beresheet 41:13). From this, we understand that a dream follows its interpretation. Who is referred to in the phrase, "me he restored to my office?" It is Joseph. Also (Joseph) hanged him because of his interpretation of the dream, and so it is written, "And it came to pass, as he interpreted to us, so it was" (Ibid.).