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! Request now

Reply
Manas1415
Frequent Visitor

Understanding an Expression (Lookupvalue function)

Hi Everyone,

 

I'm fairly new to Power BI and facing some troubles in understanding a particular expression which was already built by someone.

Any kind of help is much appreciated.

 

Table 1:

Column_1    Column_2    Column_3

A                

B

C

                    A

                    D

                    E

F                  G

G                 H

H

                    I

                    J

 

Table 2:

Field_1        Field_2

A                  M

B                   N

C                  O

D                  P

E                   Q

F                   R

G                  S

H                  T

I                   U

J                   V

 

 

So Column_3 is a calculated column with the following DAX Expression:

Column_3 = IF(
                ISBLANK(
                    LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_2]), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
)

Can someone help me understand this formula?

 

Why couldn't we use the following expression? (I tried using the following formula but it doesn't pull the correct values)

 

Column_3 = IF(
                ISBLANK(
                    Table 1[Column_1]
), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_2]), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
)

 

Can someone explain me what exactly is happening here?

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Manas1415,

Column_3 = IF(
                ISBLANK(
                    LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_2]), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
)

 

If LOOKUPVALUE function returns blank value based on 'Table 1'[Column_1], then, it changes to lookup results based on 'Table 1'[Column_2].

1.PNG
 

 

Column_3 = IF(
                ISBLANK(
                    'Table 1'[Column_1]
), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_2]), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
)

 

This formula is also correct. But you need to add the single quote as highlighted in below image.

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Manas1415,

Column_3 = IF(
                ISBLANK(
                    LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_2]), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
)

 

If LOOKUPVALUE function returns blank value based on 'Table 1'[Column_1], then, it changes to lookup results based on 'Table 1'[Column_2].

1.PNG
 

 

Column_3 = IF(
                ISBLANK(
                    'Table 1'[Column_1]
), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_2]), LOOKUPVALUE('Table 2'[Field_2],'Table 2'[Field_1],'Table 1'[Column_1])
)

 

This formula is also correct. But you need to add the single quote as highlighted in below image.

2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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
Top Kudoed Authors