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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Do value search between two tables

Hello, 

I have two tables and in one of them I would like to create a column "IS" column which returns the value of "ServiceB" if "nameA" exists in "nameB" otherwise it returns the value "T". Can you please help me do this? 

TABLE A :

DateNomAServiceA
2021-09totoyes
2021-09dreamno
2021-09firehurry

 

TABLE B :

DateNomBServiceB
2021-09iceyes
2021-09dreamno
1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@Anonymous  as calculated column

 

calculatedColumnWithTREATAS = 
VAR _a =
    CALCULATE (
        CALCULATE (
            MAXX ( t2, 't2'[ServiceB] ),
            TREATAS ( VALUES ( t1[NomA] ), t2[NomB] )
        )
    )
RETURN
    IF ( ISBLANK ( _a ), "T", _a )

 

 

smpa01_1-1637109629605.png

 

 

as measure

measureWithTREATAS = 
VAR _a =
    CALCULATE (
        MAXX ( t2, 't2'[ServiceB] ),
        TREATAS ( VALUES ( t1[NomA] ), t2[NomB] )
    )
RETURN
    IF ( ISBLANK ( _a ), "T", _a )

 

smpa01_2-1637109698522.png

 

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

5 REPLIES 5
smpa01
Super User
Super User

@Anonymous  as calculated column

 

calculatedColumnWithTREATAS = 
VAR _a =
    CALCULATE (
        CALCULATE (
            MAXX ( t2, 't2'[ServiceB] ),
            TREATAS ( VALUES ( t1[NomA] ), t2[NomB] )
        )
    )
RETURN
    IF ( ISBLANK ( _a ), "T", _a )

 

 

smpa01_1-1637109629605.png

 

 

as measure

measureWithTREATAS = 
VAR _a =
    CALCULATE (
        MAXX ( t2, 't2'[ServiceB] ),
        TREATAS ( VALUES ( t1[NomA] ), t2[NomB] )
    )
RETURN
    IF ( ISBLANK ( _a ), "T", _a )

 

smpa01_2-1637109698522.png

 

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this:

IS = 
Var _A = LOOKUPVALUE('TABLE B'[ServiceB],'TABLE B'[NomB],'TABLE A'[NomA])
return
if(ISBLANK(_A),"T",_A)

 

output:

VahidDM_0-1637100844395.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

jppv20
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Try this:

 

IS 2 = IF(LOOKUPVALUE('Table B'[ServiceB],'Table B'[NomB],'Table A'[NomA])<>BLANK(),LOOKUPVALUE('Table B'[ServiceB],'Table B'[NomB],'Table A'[NomA]),"T")
 
If I answered your question, please mark it as a solution to help other members find it more quickly.
Anonymous
Not applicable

Why are you using the blank() function?

Anonymous
Not applicable

Rena_0-1637078624308.png

 

 

 

Rena_2-1637078665157.png

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.