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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

I have included a Sample file. Maybe thats more handy

 

Sample file 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.