Why is the dimension tree not shown for some hierarchies in the filter section?

Why is the dimension tree not shown for some hierarchies in the filter section?

This problem can occur if there are Null values added in the hierarchy. Remove the Null entries to resolve the issue.