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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BobKoenen
Helper IV
Helper IV

Getting fact table data based on traversing a Flat hierarcy table

HI all,

 

I have put a lot of work in building a Flattend hierarchy table in my data model but now I want to use it in certain ways but I cannot figure out how to make it work. 

 

My data looks a bit like this

id         Name

1Captain america
2Falcon
3Ant Man
4Thor
5Ironman
6Vision
7Wolverine

 

Avengers Expenses
IDExpence
1200
1250
2500
3100
4200
5300
5150
6200

 

IDParentIDPathdepthLevel 1Level 2Level 3
1  11Captain America 
211001|22Captain AmericaFalcon 
311001|32Captain AmericaAnt man 
42502|43Captain AmericaFalconThor
45505|42IronmanThor 
5  51Ironman  
651005|62Ironmanvision 
7  71Wolverine  

 

My data model like this:

BobKoenen_0-1630857473228.png

In my dataset are alot of avenger teams and a lot more fact tables but this is de general design. 

 

I want to be able to traverse the hierarcy and use it to filter the fact table

 

For Example by a slicer on [name] from the [Avengers] table.  I want all the expenses from Avengers who are one level Above say Thor (950) or every parent above thor (including Cap 1400).

Also I would want everybody below eg, Iron Man multiplied by the % of ownership, so only 50% of the cost of Thor can be atributed to Iron Man. 

 

I would also like to be able to by slicing on a name get all avengers which are they are linked. The result should return all avengers exept Wolverine because he is not in any way linked to the others. 

 

I hope you can help me, thanks in advance!

1 REPLY 1
BobKoenen
Helper IV
Helper IV

I have included a Sample file. Maybe thats more handy

 

Sample file 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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