Formula to filter which empty groups to show

I tend to put all my statuses in one table. This makes it easier for me to color them, and I only need to reference one table. Also, it makes sense because often same status is used for different data. Basically, all statuses are the same type of data, and I want to have all of them in one table.

I often use statuses in kanban / card view.

However, when I want to show hidden groups / statuses that apply only for particular data, I can’t do that. I can only show or hide all existing groups (rows in my statuses table). It would be great if we could write a simple formula that would return which empty groups to show.

In this case, I would create a formula like this:

Which returns a list of rows in Statuses table that pass this condition.