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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Lobojo
Helper I
Helper I

How to create a vlookup between tables to retrieve a text field

Hi,

 

I'm trying to create a column in Table 1 that would be filled via a "vlookup" style from Table 2 or Table 3, depending on the 1st value in column # (if 4 -> table 2, if 2 -> table 3)

 

 

Which is the proper command to be used and how have to be connected the 3 tables in order that it works properly? I've tried various way without any correct result

 

I've tried with:

 

TEXT111 = SWITCH (

    TRUE (),

    LEFT('Table1'[#],1)=6 , RELATED ('Table3'[Text1]),

    LEFT('Table1'[#],1)=4, RELATED ('Table2'[Text1])

)

 

or with

 

text1 = switch(true,left('Table1'[#],1)=4,calculate(SELECTEDVALUE(Table2[Text1])),left('Table1'[#],1)=6,calculate(SELECTEDVALUE(Table3[Text1])))

 

but it doesn't work

 

Thanks!

 

 

Table 1  Table 2   Table 3 
#Text #4Text1  #2Text1
4100  4100Pippo  2400Minnie
4200  4200Pluto  2500Topolino
2400        
2500        

 

1 ACCEPTED SOLUTION

or you try like:

Text2 = 
MINX( FILTER(Table2, Table2[#4] = Table1[#]), [Text1] )
&
MINX( FILTER(Table3, Table3[#2] = Table1[#]), [Text1] )

FreemanZ_1-1676536871514.png

 

This approach does not rely on relationship.

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

hi @Lobojo 

if Table1 is related with Table2 and Table3, then just add a column in Table1 like:

Text = RELATED(Table2[Text1])&RELATED(Table3[Text1])

it worked like:

FreemanZ_0-1676536586864.png

 

Correct. But the table have to be related 1:1 in order to work. Thanks

or you try like:

Text2 = 
MINX( FILTER(Table2, Table2[#4] = Table1[#]), [Text1] )
&
MINX( FILTER(Table3, Table3[#2] = Table1[#]), [Text1] )

FreemanZ_1-1676536871514.png

 

This approach does not rely on relationship.

or you try like:

Text3 = 
LOOKUPVALUE(Table2[Text1], Table2[#4], Table1[#])
&
LOOKUPVALUE(Table3[Text1], Table3[#2], Table1[#])

FreemanZ_2-1676537017057.png

 

This approach does not rely on relationship as well. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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