Filter/prune empty list branches

Is there any way to prune empty branches in lists?

I have a hierarchy like this:

  1. Capability
  2. Feature
  3. Release Item
  4. Task

Using a List (or soon a Grid) I want to filter and only show tasks assigned to the current sprint. Then, I would want all the empty branches to be removed.

Using the filter of is not empty as in this screenshot:

… does not act on the dynamic data, but on the static one. Meaning that all Capabilities without Features will be hidden. But Capabilities that have Features, but which have no Tasks in this sprint, will still be shown.

Of course I can add a static formula and and then update this each time, but that is hard to maintain.

Thanks!