Forum Discussion

Housden996's avatar
Housden996
Helper II
2 years ago
Solved

How to format a Dynamic Contains String to Exclude

Hi

 

My client wants to exclude emails from a list based on key phrases being stored in a sharepoint list, is this possible. 
I am thinking something along the lines of this but there isnt a way to join the two tables are the domain for the emails are all unique:

Exclude = IF(CONTAINSSTRING('Clients and Emails'[Contact Email], 'Exclude'[Exclude]),1,0)
 
Thanks in advance!
  • Tahreem24's avatar
    Tahreem24
    2 years ago

    Housden996 Thanks for sharing this sample input data. So, here I took the sample for  EmailTable and ExcludeTable like this:

     

    Step 1: Go to Transform Data option, Select EmailTable, then select "Email" column and right click and choose "Duplicate Column"


    Step 2: Then right click on this above duplicate column and follow the below step for splitting


    Step 3: Remove the extra column after splitting

     

     

     

     

    Step 4: Click on Merge as New query option



    Step 5: Do the below setting


    Step 6: Then save and close.
    Step 7: On Table visua;, take ID and email from this Merge1 table

     

     

5 Replies

  • Housden996 , It would be great if you can share the sample input data along with expected output in order to understand your query.

     

    • Housden996's avatar
      Housden996
      Helper II

      Thanks for your response. 

       

      So the intial data table would look along the lines of:

      Then there would be another data source the client has access too where they can add records along the line of:

      I would then need some dax to exclude any of the emails which contain said phrases within the table above to return a table such as bellow:

       

       

      • Tahreem24's avatar
        Tahreem24
        Super User

        Housden996 Thanks for sharing this sample input data. So, here I took the sample for  EmailTable and ExcludeTable like this:

         

        Step 1: Go to Transform Data option, Select EmailTable, then select "Email" column and right click and choose "Duplicate Column"


        Step 2: Then right click on this above duplicate column and follow the below step for splitting


        Step 3: Remove the extra column after splitting

         

         

         

         

        Step 4: Click on Merge as New query option



        Step 5: Do the below setting


        Step 6: Then save and close.
        Step 7: On Table visua;, take ID and email from this Merge1 table