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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Create hierarchies from a column of a database

In my database, I have a column that has an account hierarchy as below:

 

1

11

111

112

1111

1112

2

21

211

2111

 

And so on...

I would like to establish a hierarchy scheme in PowerBI, where I can add all the values from the selected account down.
I do not know yet if I can do this in PowerBI or I'll have to do some mechanism in the database.

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

As the @richbenmintz said, structure of your resource table need to be changed. There are some arctile about parent and child, please review.

Parent-Child Hierarchies
Understanding Functions for Parent-Child Hierarchies in DAX

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

As the @richbenmintz said, structure of your resource table need to be changed. There are some arctile about parent and child, please review.

Parent-Child Hierarchies
Understanding Functions for Parent-Child Hierarchies in DAX

Best Regards,
Angelia

richbenmintz
Solution Sage
Solution Sage

In order to Achieve what you are after you would have to turn your single column into at least two column parent and child. Once that is done you can use the parent child functions in dax to flatten your P/C table into a standard dimension. If you are going to do the work to create the P/C table in the DB you are probably best to do all of the work in the database as you will get better sizing and compression; calculated Columns in Power BI are not compressed.



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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