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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Vishal_2202
New Member

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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