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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors