Welcome to YorkieTalk!
Buddy had that problem when he was young. I just took a few things out of his diet (the baby carrots) and made sure he drank a lot of water, even though it meant letting him jump in the tub while I was showering to drink the running water from the faucet...lol. My mom also cut his hair extremely short on his backside to make sure the hair was catching the poop.