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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Using an If statement to check 2 columns in two tables are equal

I'm making a calculated column to check if to columns in different tables are equal.  This is the statement I have made but the second table is grayed out. 

 

Location PK = IF(LEFT(Table1[whe],2) = "PK" & Table2[whe] = "PK", "Y","N")

Thanks in advance!

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

If you want to compare two columns, maybe you could try to use the RELATED function. If you want to compare the specific values in the two columns, you could use the LOOKUPVALUE function.

I made two formulas that you can reference.

Note: We need to create a relationship between the tables.

5.PNG

RELATED = IF(RELATED('Table 1'[Name]) = 'Table'[Item],"Yes","No")
LOOKUPVALUE = IF(ISBLANK(LOOKUPVALUE('Table'[Item],'Table 1'[Name],"A")), "No", "Yes")

6.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
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

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

If you want to compare two columns, maybe you could try to use the RELATED function. If you want to compare the specific values in the two columns, you could use the LOOKUPVALUE function.

I made two formulas that you can reference.

Note: We need to create a relationship between the tables.

5.PNG

RELATED = IF(RELATED('Table 1'[Name]) = 'Table'[Item],"Yes","No")
LOOKUPVALUE = IF(ISBLANK(LOOKUPVALUE('Table'[Item],'Table 1'[Name],"A")), "No", "Yes")

6.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
YJ
Resolver II
Resolver II

hi,

 

what are you looking for? 

which row context are you comparing to which row?

prehaps you can attached an example

 

regards

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.