Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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 yo...
  • smpa01's avatar
    4 years ago

    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 )

     

     

     

     

    as measure

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