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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Andmi
Frequent Visitor

Hierarchies across multiple linked tables

Hi all,

 

I am in need to create a hierarchy that goes across tables, these tables are linked through 1 to many relationships.

 

The structure I need to have is something like this:

 

-Company Name (in table 1)

--Subcompany (in table 2)

---Type of subscription (in table 2 but the table is linked by a unique company no with table 1)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, 

 

In that case I would suggest for you to do an IF STATEMENT inside which you should place this Lookupvalue. Basically,it can be like

IF (Parentid《》blank(),lookupvalue function, else block)

View solution in original post

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi @Andmi ,

 

If there are existed relationships among these tables, you can create corresponding Company Name column and Type of subscription column using RELATED function, LOOKUPVALUE function, or FIRSTNONBLANK function in Tbale2.

 

For example:

 

Column1=RELATED([one side field of relationship])

 

Column1= LOOKUPVALUE(tableA[goal field], tableA[linked field], tableB[linked field]))

 

Column1= CALCULATE (FIRSTNONBLANK ( tableA[goal field], 1 ),FILTER ( ALL ( Shifts ), tableA[linked field] = tableB[linked field] ))  

 

Then in Table2, you can create new hierarchy in Field pane. See more detail:https://www.tutorialgateway.org/create-hierarchy-in-power-bi/. (Please understand that this link is provided “AS IS” with no warranties or guarantees of content changes, and confers no rights.)

31.png

 

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi,

 

You could use a LookupValue Function in Table 2 to bring in Company column in the Second Table.

Otherwise, If you are using SSAS, then you can also Create a Hierarchy over there and Import/ Live Data.

@Anonymous  I have used the formula like this:

 

Parent Account Name = LOOKUPVALUE(salesforce_account[name];salesforce_account[id];salesforce_account[parentid]; )
 
But I want to expand it to look at the account name if the parent ID is blank. How can it be done?
Anonymous
Not applicable

Hi, 

 

In that case I would suggest for you to do an IF STATEMENT inside which you should place this Lookupvalue. Basically,it can be like

IF (Parentid《》blank(),lookupvalue function, else block)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors