Diarrhea-induced mortality among juvenile yaks is highly prevalent in the pastoral areas of the Qinghai-Tibet plateau. Although numerous diseases have been linked to the gut microbial community, little is known about how diarrhea affects the gut microbiota in yaks. In this work, we investigated and compared changes in the gut microbiota of juvenile yaks with diarrhea. The results demonstrated a considerable drop in the alpha diversity of the gut microbiota in diarrheic yaks, accompanied by Eysipelatoclostridium, Parabacteroides, and Escherichia-Shigella, which significantly increased during diarrhea. Furthermore, a PICRust analysis verified the elevation of the gut–microbial metabolic pathways in diarrhea groups, including glycine, serine, and threonine metabolism, alanine, aspartate, oxidative phosphorylation, glutamate metabolism, antibiotic biosynthesis, and secondary metabolite biosynthesis. Taken together, our study showed that the harmful bacteria increased, and beneficial bacteria decreased significantly in the gut microbiota of yaks with diarrhea. Moreover, these results also indicated that the dysbiosis of the gut microbiota may be a significant driving factor of diarrhea in yaks.