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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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