Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Housden996
Helper I
Helper I

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!
1 ACCEPTED SOLUTION

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

Tahreem24_0-1714403733233.png

Tahreem24_1-1714403748814.png

 

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

Tahreem24_2-1714403841862.png


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

Tahreem24_3-1714403918061.pngTahreem24_4-1714403941959.png


Step 3: Remove the extra column after splitting

Tahreem24_5-1714404016511.png

 

 

 

 

Step 4: Click on Merge as New query option

Tahreem24_6-1714404078243.png



Step 5: Do the below setting

Tahreem24_7-1714404223745.png


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

Tahreem24_8-1714404389740.png

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

5 REPLIES 5
Tahreem24
Super User
Super User

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

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Thanks for your response. 

 

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

Housden996_0-1714402596388.png

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

Housden996_1-1714402640937.png

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:

Housden996_2-1714402688966.png

 

 

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

Tahreem24_0-1714403733233.png

Tahreem24_1-1714403748814.png

 

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

Tahreem24_2-1714403841862.png


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

Tahreem24_3-1714403918061.pngTahreem24_4-1714403941959.png


Step 3: Remove the extra column after splitting

Tahreem24_5-1714404016511.png

 

 

 

 

Step 4: Click on Merge as New query option

Tahreem24_6-1714404078243.png



Step 5: Do the below setting

Tahreem24_7-1714404223745.png


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

Tahreem24_8-1714404389740.png

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Thank you this is the same solution I have come up with as well which will work for most instances.

@Housden996 , You're welcome! 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.