Forum Discussion
Help Needed with Visualizing Managerial Headcount Hierarchy in Matrix – Handling Variable Depths
- 1 year ago
Hi katina,
Thank you for your follow up.
Please find attached a screenshot and a revised sample PBIX file that may help resolve the issue:
We hope the information provided is useful. If you have any further queries, please feel free to contact the Microsoft Fabric community.Thank you.
Okay, here is a simple illustration what happens in the matrix. If this helps to solve my question govind_021 Shahid12523 Nabha-Ahmed
- Nabha-Ahmed1 year ago
Super User
The null levels just mean that no employees exist under that branch — you can filter them out using ISBLANK() or PATHLENGTH() so only real departments show up.
- Nabha-Ahmed1 year ago
Super User
AND,
Here’s a helpful video that walks through how to **remove blank levels in ragged hierarchies**—using functions like **ISINSCOPE**, **PATHLENGTH**, and DAX logic to dynamically hide empty levels:
[DAX Fridays! #112: Remove blanks from hierarchies with ISINSCOPE](https://www.youtube.com/watch?v=YEuxONjCl1A&utm_source=chatgpt.com)
Also, here’s a Microsoft Community article that offers a formula-based method to hide blank hierarchy values using a measure and visual-level filters:
You can use DAX like:```DAX
Measure =
IF (
HASONEVALUE ( Table[HierLevel] )
&& MAX ( Table[HierLevel] ) <> BLANK (),
SUM ( Table[Value] ),
CALCULATE ( SUM ( Table[Value] ), ALL ( Table[HierLevel] ) )
)
```This replaces blank levels with actual values only when they exist.
([community.fabric.microsoft.com][1])If either of these helps you clean up the matrix, let me know—or mark it as a solution!
[1]: https://community.fabric.microsoft.com/t5/Desktop/Hide-Blanks-Values-in-Matrix-Hierarchy/m-p/648253?utm_source=chatgpt.com "Hide Blanks Values in Matrix - Hierarchy"