Question: Why does the Magen Avraham (Orach Chaim 494:1) and others say you cannot fast on Shavuos a taanis chalom, fast after a bad dream, but can fast on other yom tovim and Shabbos?
A. A taanis chalom is fasted by an individual if he is so unsettled about a dream one has that he feels he must fast as an atonement to relieve his anguish. He is even allowed to do so on Shabbos and Yom Tov, though he has a mitzvah to delight on these days and is forbidden to fast, but in this case fasting is what brings this anguished person to delight so he is permitted to do so.
B. The Gemara in Pesachim 68b says that everyone agrees that on Shavuos one must dedicate part of the day to “lachem” to oneself, in delighting in the day and not just learning and praying the whole day. Rashi there explains that one should be joyous with food and drink to show how one is satisfied and accepts the day the Torah was given. Even learning Torah the whole day would not suffice.
Answer: On Shavuos one is obligated to share with others your enjoyment over accepting the Torah which is clearly seen by having a meal, it is not enough to learn Torah the whole day, or to fast even though they both bring delight for the person. (See Dirshu Mishna Berura 594:3:11:17.)