Forum Discussion

Kamill11's avatar
Kamill11
Icon for Helper I rankHelper I
5 years ago

compare columns with text values in different queries

Hi everyone,

I need to do measure for:

if the value in column 1 is contained in column 2 then it displays "YES", if none it displays "NO", Columns are in different queries, and they both are in text format.



I try to do it like this.

M = IF(CONTAINSSTRING(SUM(Column2),SUM(Column1)),"YES","NO")

But there is problem with SUM, becouse of STRING.

Can someone help me? thank you. 

2 Replies

  • Kamill11 , A new column

    var _col = [Column1]

    return

    if(search(_col, [column2],,0) >0 , "Yes", "No")

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

      Should work, but the column1 and column2 are in different queries, and report is in DirectQuery mode.  Is that problem or I do something wrong?