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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Help with formula please

Can you please tell me why my formula does not work?

 

AE role= if ( [Job Family]="Direct Sales" && (CONTAINS ( Roster,[Job Title],"Account Executive")=TRUE),"AE","")

 

Many thanks!

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

The @Greg_Deckler solution will 100% cover your request; Just remove that Bracket ) at the end.

and if you want to replace "null" with blank use this:

 

if [Job Family] = "Direct Sales" and Text.Contains([Job Title] , "Account Executive") then "AE" else ""

 

 

VahidDM_0-1631072318602.png

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Sorry, I should have been more clear. I have a roster of people. I want to identfy "Account executives", but I need to use 2 fields for this: I need the job family column to be "Direct Sales" and I need the job title to contain "account executive". I want a new column called "AE role" that says "AE" when both these criteria are true.

Here is my data:

IDJob TitleJob FamilyAE Role
3Account Executive 4, Business Development - SalesBusiness Development - Sales 
4Account Executive 4, Channel SalesChannel Sales 
9Account Executive 1, Channel SalesChannel Sales 
14Account Executive 5, Direct SalesDirect SalesAE
24Account Executive 4, Direct SalesDirect SalesAE
25Account Executive 2, Services SalesServices Sales 
26Account Executive 2, Business Development - SalesBusiness Development - Sales 

 

I get this when I try to add a custom column, unless, is there a way to add a conditional column with an AND?

 

laurab_0-1631062234130.png

Thank you!!

@Anonymous You are trying to use DAX in Power Query and that is not going to work out very well for you. You need to do this in a calculated column in Power BI Desktop, not Power Query Editor. Or you need the M equivalent which is something along the lines of:

if [Job Family] = "Direct Sales" and Text.Contains([Job Title],"Account Executive")then "AE" else null)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Anonymous 

 

The @Greg_Deckler solution will 100% cover your request; Just remove that Bracket ) at the end.

and if you want to replace "null" with blank use this:

 

if [Job Family] = "Direct Sales" and Text.Contains([Job Title] , "Account Executive") then "AE" else ""

 

 

VahidDM_0-1631072318602.png

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

@VahidDM Thanks, missed that paren!!



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Anonymous Not really enough information but try:

AE role= if ( [Job Family]="Direct Sales" && (SEARCH("Account Executive",[Job Title],0) > 0 ) ,"AE", "")

Otherwise, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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