Forum Discussion

luizpansarini's avatar
luizpansarini
Regular Visitor
9 years ago
Solved

Check if columns Exists in other Table

Hi everyone!

 

I need to create a measure that checks how columns (Process and Problem) of my table1 exist in table 2. If it does, return the field's Deployment date in new column, it is not, return blank in that new column

 

How can I do?

Table1Table2

 

 

  • luizpansarini,

     

    Better to add a calculated column instead.

    Deployment Date =
    LOOKUPVALUE (
        Table2[Deployment Date],
        Table2[Category], Table1[Category],
        Table2[Product], Table1[Product],
        Table2[Process], Table1[Process],
        Table2[Problem], Table1[Problem]
    )
    

3 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    luizpansarini  do you need both the problem and process to match?

     

    i am not sure if this is the most elegant way but i would probably create a table in the middle

     

    i.e a unique list of all the problems + processes as a key

     

    and then create that key in either table too, and then join them with bi directional relationships

     

    then all you need to do is create a measure a firstdate(date), lastdate(date) sort of thing but i might be oversimplifying this

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Icon for Community Support rankCommunity Support

    luizpansarini,

     

    Better to add a calculated column instead.

    Deployment Date =
    LOOKUPVALUE (
        Table2[Deployment Date],
        Table2[Category], Table1[Category],
        Table2[Product], Table1[Product],
        Table2[Process], Table1[Process],
        Table2[Problem], Table1[Problem]
    )