Forum Discussion

Epinephrin's avatar
Epinephrin
Regular Visitor
6 years ago
Solved

How can I count the values without VLOOKUP?

Hello everyone,

 

I would like to check if a value in column A already has any value in column B (no matter which one).

Normally I would solve the problem with VLOOKUP:

 

=IF(VLOOKUP(A1;$A$1:$B$12;2;FALSE)>0; "Yes"; "No")

 

How can I enable this in Power BI?

Thanks in advance.

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Epinephrin ,

     

    Something like below?

    Column = IF('Table'[Column1] in VALUES('Table'[Column2]),"YES","NO")

     

    Best Regards,

    Jay

4 Replies

  • Epinephrin ,

    Try new column like

    Count = countx(filter(Table,table[colA] =earlier(Table[ColB])),Table[ColB])

    or

    Flag = if(isblank(countx(filter(Table,table[colA] =earlier(Table[ColB])),Table[ColB])) ="No","Yes")

    • Epinephrin's avatar
      Epinephrin
      Regular Visitor

      Hey,

       

      thank you. But the results from your first formular are empty and the second doesn't work because: 

      DAX comparisons do not support comparisons between True/False and Text type(?).

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Epinephrin ,

     

    Something like below?

    Column = IF('Table'[Column1] in VALUES('Table'[Column2]),"YES","NO")

     

    Best Regards,

    Jay