Forum Discussion

PSB's avatar
PSB
Helper III
3 years ago
Solved

Compare two cells using DAX or Power Query

I want to check if all values in Souce column exist in Target Column.

If I can get True or False, it's good. 

If I can get Exact value that's missing, it's better.

 

Cell_IdSourceTargetCheck Source in Target?Check Source in Target?
KNJ01002A11389090,507870,520110,126490389090,126490,505950,520110FALSEMissing 507870
KNJ01002A21389090,507870,126490,520110389090,126490,505950,520110FALSEMissing 507870
KNJ01002A31389090,507870,126490,520110389090,126490,505950,520110FALSEMissing 507870
ANJ01002A11389090,507870,505950,520110,126490389090,126490,505950,520110FALSEMissing 507870
ANJ01002A21389090,507870,505950,520110,126490389090,126490,505950,520110FALSEMissing 507870
ANJ01002A31389090,507870,505950,520110,126490389090,126490,505950,520110FALSEMissing 507870
ANJ01002A12505950,520110389090,126490,505950,520110TRUEAll Exist
ANJ01002A22505950,520110389090,126490,505950,520110TRUEAll Exist
ANJ01002A32505950,520110389090,126490,505950,520110TRUEAll Exist

 

 

 

 

 

  • PSB's avatar
    PSB
    3 years ago

    your solution worked perfectly. Can't thank you enough for your help.

    Only thing I need is "," between the result like shown below. 

     

    Actual Result:  Missing 126490389090

    Result I need:  Missing 126490,389090

  • Hi PSB 

    I updated the link yesterday to reflect the changes to CONCATENATEX's delimiter.

    I hope it works for you.

5 Replies

  • Hello PSB ,

     

    You could add a calculated column with the following measure 

     

    Check Source in Target = IF('Table'[Source] = 'Table'[Target], "True","false")
     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

     

    Follow me on Linkedin

    • PSB's avatar
      PSB
      Helper III

      your solution worked perfectly. Can't thank you enough for your help.

      Only thing I need is "," between the result like shown below. 

       

      Actual Result:  Missing 126490389090

      Result I need:  Missing 126490,389090

      • grantsamborn's avatar
        grantsamborn
        Solution Sage

        Hi PSB 

        I updated the link yesterday to reflect the changes to CONCATENATEX's delimiter.

        I hope it works for you.

  • PSB's avatar
    PSB
    Helper III

    I want to flag as true even if source is "123-234" and Target is "012-123-234-013"