Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

IF statement between 2 fields from different Data sources

Hi, 

I need to create another column/calculated field - If(id_vendor="UNKN",Rerefence,id_vendor). 

i guess because id_vendor and reference are fields from different data sources, i cant. Do you have any idea how to do this?

 

You can see bellow, how the table looks like. 

Thanks in advance

 

 

2 Replies

  • aj1973's avatar
    aj1973
    Community Champion
    Hi Anonymous 
    Normally you are looking for a fourmula like this : 
    Column =
    var col = CONTAINS(Table1, Table1[id_vendor], "UNKN")
    Return
    IF(col ,RELATED(Table2[Reference]), id_vendor)
     
    However for this formula to work Columns 'Reference' and 'id_vendor' have to be same format(Text)
     
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Unfortunately, it does not work. i got an error when using this REATED function. can you help please ?