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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Cipriano
Helper III
Helper III

Get value string in related tables.

Hello everyone,

I need to obtain the column value of a related table at level 1, from another table at level 5. Using the RELATED function I can only get to the immediate level, which would be that of table 4.

searchString = RELATED(TableD[id]

 

Data example:

 

Table A    
Level-1IDName  
 A01Product 1  
 A02Product 2  
     
Table BIDNamefk_tableA 
Level-2B01SubProduct 1A01 
 B02SubProduct 2A01 
 B03SubProduct 1A02 
 B04SubProduct 2A02 
     
Table CIDNamefk_tableB 
Level-3C01Category1B03 
 C02Category2B03 
 C03Category1B04 
 C04Category2B04 
     
Table DIDNamefk_tableC 
Level-4D01SubCategory1C01 
 D02SubCategory2C01 
 D03SubCategory3C01 
 D04SubCategory1C02 
     
Table EIDNamefk_tableCCALCULATE
Level-5E01Sale1D01Product 2
 E02Sale2D02Product 2

 

Calculate = Value of column name of Table A, id A02.

Thank you very much!

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Cipriano,

 

Try this calculated column in TableE:

 

Table A Name = 
VAR vFK_D = TableE[fk_tableD]
VAR vFK_C =
    MAXX ( FILTER ( TableD, TableD[ID] = vFK_D ), TableD[fk_tableC] )
VAR vFK_B =
    MAXX ( FILTER ( TableC, TableC[ID] = vFK_C ), TableC[fk_tableB] )
VAR vFK_A =
    MAXX ( FILTER ( TableB, TableB[ID] = vFK_B ), TableB[fk_tableA] )
VAR vResult =
    MAXX ( FILTER ( TableA, TableA[ID] = vFK_A ), TableA[Name] )
RETURN
    vResult

 

DataInsights_0-1661704983111.png

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@Cipriano,

 

Try this calculated column in TableE:

 

Table A Name = 
VAR vFK_D = TableE[fk_tableD]
VAR vFK_C =
    MAXX ( FILTER ( TableD, TableD[ID] = vFK_D ), TableD[fk_tableC] )
VAR vFK_B =
    MAXX ( FILTER ( TableC, TableC[ID] = vFK_C ), TableC[fk_tableB] )
VAR vFK_A =
    MAXX ( FILTER ( TableB, TableB[ID] = vFK_B ), TableB[fk_tableA] )
VAR vResult =
    MAXX ( FILTER ( TableA, TableA[ID] = vFK_A ), TableA[Name] )
RETURN
    vResult

 

DataInsights_0-1661704983111.png

 





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

Proud to be a Super User!




Thank you very much!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors