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
RMV
Helper V
Helper V

lookup with 2 search columns

Hi, I need to get a value from another table, with 2 search columns I tried to use this formula: LOOKUPVALUE = (Table2[ColumnToRetrieve], Table2[Entity], Table1[Entity], Table2[No.], Table1[No.]) for example: Table2 Entity No. ColumnToRetrieve A 1 2000 B 2 3000 What I need in Table1 Transaction Entity No. ColumnToRetrieve 123 A 1 2000 234 A 1 2000 345 B 2 3000 However, the formula I'm currently using returns blank value at Table1. Need advise what formula should I use. Thanks

7 REPLIES 7
RMV
Helper V
Helper V


@RMV wrote:

Hi, I need to get a value from another table, with 2 search columns I tried to use this formula: LOOKUPVALUE = (Table2[ColumnToRetrieve], Table2[Entity], Table1[Entity], Table2[No.], Table1[No.]) for example: Table2 Entity No. ColumnToRetrieve A 1 2000 B 2 3000 What I need in Table1 Transaction Entity No. ColumnToRetrieve 123 A 1 2000 234 A 1 2000 345 B 2 3000 However, the formula I'm currently using returns blank value at Table1. Need advise what formula should I use. Thanks


 

Hi,

I need to get a value from another table, with 2 search columns

I tried to use this formula:

LOOKUPVALUE = (Table2[ColumnToRetrieve], Table2[Entity], Table1[Entity], Table2[No.], Table1[No.])

 

for example:

Table2

Entity     No.      ColumnToRetrieve

A             1           2000

B             2           3000

 

What I need in Table1

Transaction    Entity    No.    ColumnToRetrieve

123                  A          1        2000

234                  A          1        2000

345                  B           2       3000

 

However, the formula I'm currently using returns blank value at Table1.

Need advise what formula should I use. Thanks

Hi @RMV,

 

This works fine for me

 

=LOOKUPVALUE(Table2[ColumnToRetrieve],Table2[Entity],[Entity],Table2[No.],[No.])

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Try This

=
CALCULATE (
    VALUES ( Table2[ColumnToRetrieve] ),
    FILTER ( Table2, Table2[Entity] = Table1[Entity] && Table2[No.] = Table1[No.] )
)

Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad,

 

Tried your advise.

However, when I used the formula, the columns at Table1 is not recognized.

Need further advise. Thanks.

 

 

 

Hi @RMV

Please type the formula and use Power BI's intelliesense to select Table1 Columns.

It could be that you copied and pasted the formula and there was a slight difference in column names.

This formula works fine with me with your data.

 


Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad@Ashish_Mathur,

 

Tried both of your formula. I typed it, and not just copy paste it.

But, I still can't manage it.

Do I have to create relationship first, or is there anything I need to look at?

Hi @RMV

 

What error do you get this time?

Could you embed an image of Table2 in Power Pivot Data Model?


Regards
Zubair

Please try my custom visuals

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.