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
Vishal_2202
Regular Visitor

IF Condition

I want value

IF (table1.column1 = table1.column2), THEN (table2.column1) ELSE blank text.

 

Please specify if tabel1 and table 2 must have relationship.

 

@tamerj1  can you help?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Vishal_2202 ,

I created some data:

Table1:

vyangliumsft_0-1672990261918.png

Table2:

vyangliumsft_1-1672990261920.png

Two tables don't necessarily need to be related, you can use the Lookvalue() function

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Here are the steps you can follow:

1. Create calculated column.

Flag =
IF(
    'Table1'[Column1]='Table1'[Column2] ,
    LOOKUPVALUE('Table2'[Value],'Table2'[GroupTable2],'Table1'[Column1]),BLANK())

2. Result:

vyangliumsft_3-1672990321713.png

 

Best Regards,

Liu Yang

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

6 REPLIES 6
Anonymous
Not applicable

Hi  @Vishal_2202 ,

I created some data:

Table1:

vyangliumsft_0-1672990261918.png

Table2:

vyangliumsft_1-1672990261920.png

Two tables don't necessarily need to be related, you can use the Lookvalue() function

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Here are the steps you can follow:

1. Create calculated column.

Flag =
IF(
    'Table1'[Column1]='Table1'[Column2] ,
    LOOKUPVALUE('Table2'[Value],'Table2'[GroupTable2],'Table1'[Column1]),BLANK())

2. Result:

vyangliumsft_3-1672990321713.png

 

Best Regards,

Liu Yang

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

tamerj1
Super User
Super User

Hi @Vishal_2202 
You can write it same way you read it 

=
IF ( table1[column1] = table1[column2], table2[column1] )

What about if the condition doesn't satisfy then can we write a specific text like 'BLANK' 

 

And does the tables must have relation

 

@tamerj1 thanks for quick reply..😊

@Vishal_2202 
I just noticed you have edited the post. Yes you need a relationship between the two tables but what would be the filter direction? Blank is returned by default, no need to write it.

Sorry to bother you but the problem is that column1 and column2 from table 1 is measures so it didn't catch the table 2's column.

@Vishal_2202 
This is why I'm asking about the direction of the relationship filter?

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.