Forum Discussion

PedroPascual's avatar
PedroPascual
Icon for Helper I rankHelper I
3 years ago

COnditional column comparing many values agains different tables

Hi Community,
hope you can help me with this issue i have.

i would need to create a conditional column comparing information from columns of the same table agains columns of other tables.

Example

I have this table two tables

 TABLE 1   
COLUMN 1COLUMN 2COLUMN 3COLUMN 4COLUMN 5
ABDE

 

 TABLE 2 
AREA 1 AREA 2AREA 3
A35

i need to create a new column with the folloing condition:
If column1 of Table1 is equal a Area1 of table2 , AND Column2 of table1 is equal to area2 table, AND column 3 of table1 is equeal to Area3 of Table2 , then YES ; otherwise NO

 

if this possbile?

 

Regards

2 Replies

  • PedroPascual 

    Table = DISTINCT(UNION(ALL(A[AssectName]),ALL(B[AssectName]),ALL(C[AssectName])))

     

    Then add three columns in combined table , like this:

    AssectName A = SWITCH(TRUE(),'Table'[AssectName] in VALUES('A'[AssectName]),"Yes","No")

    AssectName B = SWITCH(TRUE(),'Table'[AssectName] in VALUES('B'[AssectName]),"Yes","No")

    AssectName C = SWITCH(TRUE(),'Table'[AssectName] in VALUES('C'[AssectName]),"Yes","No")


    THANK YOU!!

    • PedroPascual's avatar
      PedroPascual
      Icon for Helper I rankHelper I

      Mahesh0016 thanks for the response.

      however the result of the condition shall be one value, "yes or no" depending on the results of the comprarisions.

      if all of the conditions are yes, then the result is Yes, if just one condition is no, then the single results in "NO".

      i would need and prefer to have this formula in the main table.

      Regards