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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors