Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Hierarchy Table with Labels

We have a hierarchy following the classic parent/child design.  Each record has a field for its own parent.   We know how to use the PATH to calculate levels.   We have seen how to make this work in a matrix.  The problem we have is that unlike the typical employee or chart samples where the field identifier is meaningful to an end user to drill (name), in our case our hierarchy is made up of ID field, each record having a description.  Asking an end user to drill on an ID without a description will not work.   What we really want is to display the heirarchy in a table, where each row shows the ID, description, and other fields, and drill to the children of that record.   It is textual data so a chart is not appropriate.  In the example below we would want to see each record alone at each drill level, and both children together.  Is this possible?

 

ID   Parent  Label

01   Null      Grand Parent

02   01         Parent
03   02         Child

04   02         Another Child

 

3 REPLIES 3
ChrisMendoza
Resident Rockstar
Resident Rockstar

@Anonymous, 

 

Have you tried the following found in the pattern example @ https://www.daxpatterns.com/parent-child-hierarchies/:

 

HierarchyPath = PATH(Table1[ID],Table1[Parent])

HierarchyDepth = PATHLENGTH ( Table1[HierarchyPath] )

Level1Label = 
LOOKUPVALUE (
    Table1[Label],
    Table1[ID],
    PATHITEM ( Table1[HierarchyPath] , 1, 1 )
)

Level2Label = 
IF (
    Table1[HierarchyDepth] >= 2,
        LOOKUPVALUE (
        Table1[Label],
        Table1[ID],
        PATHITEM ( Table1[HierarchyPath] , 2, 1 )
        ),
        Table1[Level1Label]
)

Level3Label = 
IF (
    Table1[HierarchyDepth] >= 3,
        LOOKUPVALUE (
        Table1[Label],
        Table1[ID],
        PATHITEM ( Table1[HierarchyPath] , 3, 1 )
        ),
        Table1[Level2Label]
)

The pattern example also explains how to use a technique to hide the unecessary aggregation that is show in the visual (e.g. [BrowseDepth] & [MaxLevelDepth])

 

What I've provided will display the following in a matrix:

2.PNG






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

If I understand your requirement correctly, you'd like to show the details of each level due to they are all numerical IDs. Is it? Maybe you can try the page tooltip. Please refer to power-bi/desktop-tooltips.

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Dale,

   Unfortunately custom tooltips are not supported for tables or matrices, only charts.  Even if they were, it would mean we would present a screen of meaningless numbers on a single column matrics where the only way to understand them would be to hover over each one.

    - Pete

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.