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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

If - Then - without Else

Hi everyone, 

 

I have a marketing database with thousands of email addresses and company names and I import all these data in Power Bi.

 

Unfortunately our system doesn't talk with our CRM and this is a problem cause when people go on our Power Bi dashboard they filter a company name using the one on our CRM system but it might happen that the company's name on Power Bi is different. An example would be like below:

 

Marketing

Company name = Water for Sport

 

CRM:

Company name = Water Sport

 

Now a way that I have found to fix this issue is using the conditional statement 'IF - Then' in Power Bi. For instance I can say: If email address contains @watersport.com then company name is 'Water for Sport'. 

 

The above logic works perfectly however in this type of statement there is then the option 'else'. This results to be a problem for my specific case cause as i said before I have thousands of companies and actually the ones I am interested to 'trim' are just around 200. If I proceed with this approach I will then loose all the other companies for which I don't set up a rule. 

 

I was wondering then if there is a way to use the 'If and then' statement ignoring the 'Else' command. Just to let you know if I leave the 'else' blank then all the other companies won't appear.

 

Thanks in advance, 

Alessandro

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

Hi @Alessandro-laba 

If you are doing this in Power Query and creating a Custom Column, then you are checking an existing column to check the email address.  If you don't find the text you are searching for, the else can just output this unmodified column - for example

 

if Text.Contains([Email_Address] , "@watersport.com") then "Water for Sport" else [Email_Address]

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

AlB
Super User
Super User

Hi@Alessandro-laba 

I'm not sure I understand fully. You can perhaps  do something like:

= if Text.Contains([emailaddress], "@watersport") then  "Water for Sport"  else [emailaddress]

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

View solution in original post

3 REPLIES 3
AlB
Super User
Super User

Hi@Alessandro-laba 

I'm not sure I understand fully. You can perhaps  do something like:

= if Text.Contains([emailaddress], "@watersport") then  "Water for Sport"  else [emailaddress]

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

PhilipTreacy
Super User
Super User

Hi @Alessandro-laba 

If you are doing this in Power Query and creating a Custom Column, then you are checking an existing column to check the email address.  If you don't find the text you are searching for, the else can just output this unmodified column - for example

 

if Text.Contains([Email_Address] , "@watersport.com") then "Water for Sport" else [Email_Address]

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thank you very much, it worked perfectly!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.