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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Sandie_Fong
New Member

IF Contain function value

I need to create a new column called "Job Group" based on the "EE List.Job" list. 

 

If the cell contain HSS, RN, Clinician from the EE List.Job, then the new column of the corresponding row shows "HSS", "RN", "Clinician".

 

Thanks in advance! 

 

Sandie_Fong_0-1731989703863.png

 

1 ACCEPTED SOLUTION
shafiz_p
Super User
Super User

Hi @Sandie_Fong  Try below code in power query advance option:

= Table.AddColumn(#"PreviousStepName", "Job Group", each if Text.Contains([EE List.Job], "HSS") then "HSS" else if Text.Contains([EE List.Job], "RN") then "RN" else if Text.Contains([EE List.Job], "Clinician") then "Clinician" else null)

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

 

Best Regards,
Shahariar Hafiz

View solution in original post

4 REPLIES 4
Omid_Motamedise
Super User
Super User

You c an use

 

if Text.ContainsAny([EE List.Job], {"casee 1","casee 2","casee 3","casee 4"}) then ................. else ...........


If my answer helped solve your issue, please consider marking it as the accepted solution.
AlienSx
Super User
Super User

Table.AddColumn(Source, "Job Group", each List.Intersect({Text.Split([EE List.Job], " "), {"HSS", "RN", "Clinician"}}){0}?)
shafiz_p
Super User
Super User

Hi @Sandie_Fong  Try below code in power query advance option:

= Table.AddColumn(#"PreviousStepName", "Job Group", each if Text.Contains([EE List.Job], "HSS") then "HSS" else if Text.Contains([EE List.Job], "RN") then "RN" else if Text.Contains([EE List.Job], "Clinician") then "Clinician" else null)

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

 

Best Regards,
Shahariar Hafiz

Thank you! I was trying to write this myself but have error with expression. Yours worked. 

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.