Hi,
The blog you provided also used the hierarchyname.
Depth() provides the node or level number of the hierarchy.
You need to use the Heirarchyname. Like Region is the name of the hierarchy and it has Country>>State>>City
so the formula would be Region.depth = 2 then hide.
Thanks,
Jothi