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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
elflakoconk
Helper II
Helper II

Relational schemmes with 2 tables

Hello everyone.

 

Some time ago I made a post about data relationships for a hierarchical schema:

 

https://community.powerbi.com/t5/Translated-Spanish-Desktop/Esquema-jerarquico-cuenta-incompleta-de-...

 

Now continuing with this topic I have 2 doubts:

 

1. How these relations should be created?

2. How can I count all the data related to each level per user?

 

This is the  relation schema I'm working:

 

elflakoconk_0-1621703575438.png

 

The data comes from 2 tables, [usuarios] (the black color guys) & [hijos] (the red color guys).

In the [usuarios] table there is a relation using fileds "CVE" & "CVE_padre", beacause a user can have another users under his command.

And the table [hijos] got the field "CVE_padre" wich connects to field "CVE" from [usuarios] table.

 

The way I solved this is:

1. Identify the top level users from table [usuarios]

2. create a new table for each relation/level

3. Combine the tables through mentioned fields

 

 

elflakoconk_1-1621708152863.png

elflakoconk_0-1621710738181.png

 

4. I need to combine [hijos] with his correspondant [usuario]. (I didn´t do this, because i guess this could be to heavy process, repeating the combining for each [usuario]).

 

This is the link to mentioned tables:

https://legazpyy-my.sharepoint.com/:x:/g/personal/alberto_legazpy_com/EWDbHPlW25RPkB7AUImvqGMBd26q6q...


Thanks a lot.

1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

The key to working with hierarchies in Power BI is flattening them in one table. The fact that in a table you'll have many repetitions is a good thing in the dimensional data modeling world. Your worry is totally ill-founded. You can read about how to handle parent-child hierarchies here: https://www.daxpatterns.com/parent-child-hierarchies/

 

View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

What is the visual you are trying to create? Can you provide a sample depiction?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






I may use matrix or hierarchy schemme or bar graph, also filtering by a common value. Listing the level 1 users to compare the total value for each one and drill down to level 2 users and so on.

daxer-almighty
Solution Sage
Solution Sage

The key to working with hierarchies in Power BI is flattening them in one table. The fact that in a table you'll have many repetitions is a good thing in the dimensional data modeling world. Your worry is totally ill-founded. You can read about how to handle parent-child hierarchies here: https://www.daxpatterns.com/parent-child-hierarchies/

 

Thanks, that's the solution, and that's a great post!!! . 

The only thing that makes me doubt is that everything is made in DAX, but actually im working with 15k records and it still fast!

Thanks again!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.