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

Star chema with parent-child hierarchy in a dimension

Hi everyone,

 

My post is related to the star schema that I want to use in PowerBI.  I am trying to transpose a relational database into a star schema but I have a problem on one of my tables.

 

This table is called "Contract", and is composed of contracts and sub-contracts.


A sub-contract is necessarily attached to a contract, by a "parentId" column which is the id of the "parent" contract. A contract can have several sub-contracts, but a sub-contract cannot have a sub-contract (so a maximum depth of 1).

 

My company marketing service wants to see the revenus per contract, per sub-contract or per contract+sub-contract. 

 

I would like to know how I should handle this problem : should I keep the table as it is and make it a dimension (so in this dimension I would have the contracts and the sub-contracts, with a parentId key) or should I do it another way ?

 

Thanks in advance for your help!

 

1 REPLY 1

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.