You normally either get to sacrifice all other creatures, or can have Yahenni die due to combat damage.
Activated abilities can be activated by a player at any point they have priority. In the scenario you describe, the last opportuinity you have to sacrifice all other creatures that player controls is in the Declare Blockers step, after blockers are declared, as the next step is the Combat Damage step, in which all creatures deal damage and will die due to state-based actions if they have lethal damage marked on them (unless they are Indestructible).
The activated ability itself will be put on the stack as soon as you activate it, meaning whenever you sacrifice a creature, the next thing happening (assuming nothing else is cast or activated in response) is Yahenni gaining Indestructible. Since it's state-based actions that destroy creatures wil lethal damage, and state-based actions don't use the stack, you don't get priority to activate the ability in response.
Depending on the exact abilities of the other creatures your opponent controls, it's possible to make this work - for example, if your opponent controls a Elesh Norn, Grand Cenobite and Yahenni is a 4/4 because of it, having it dealt 2 damage in the Combat Damage step, then sacrificing all your other creatures, and finally Elesh Norn, will get rid of all creatures, because Yahenni will briefly be a 2/2 again, with 2 damage marked on it, and be destroyed by state-based actions before the ability to grant it Indestructible resolves.