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
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
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.