He will be replaced by the Oakland Athletics' Matt Chapman.
Yelich, the reigning National League MVP, leads the majors with 31 home runs. He was not in the lineup for Sunday's game against the Pittsburgh Pirates, but he plans on playing in the All-Star Game.
"I'd still like to try and play," said Yelich, who was voted a starter for Tuesday's game. "I think I'll be able to. It's just I didn't think I was going to be able do that kind of volume of swings and what the derby demanded. If I wasn't going to be able to perform how I was supposed to and do it justice and give it the effort that it deserved, I didn't think it'd be a great idea to do it."
Milwaukee manager Craig Counsell said the team is not expecting Yelich to miss any time after the break. He has the club's approval to play on Tuesday.
"This is not an injury-list type injury by any means," Counsell said. "I'd like him to play if he's able."
Chapman, who has 21 home runs, was named to his first All-Star Game last week. His father, Jim, will pitch to him in the Derby.
"I'm excited," Chapman said, according to the San Francisco Chronicle. "I knew I was on a list of people they could call if someone dropped out. It will be a fun time; it's something I've always dreamed of doing."
He added: "When I was a little kid, we'd watch the Home Run Derby and I don't think we thought in a million years I'd be in a Home Run Derby, but at the time, my dad was like, 'If you ever got to do that, I would want to throw to you.'"
Chapman said his dad still plays softball once a week but that he hasn't thrown him batting practice since high school.
"But I trust him," he said.
The Associated Press contributed to this report.