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
cristianml
Post Prodigy
Post Prodigy

If contains a specific group of words for a column then

 

I need to get a way to find a specific group of words for a column cause interferes with other text:

 

Example: I need to get SC for STRATEGY CONSULTING from VAR5 instead of CON that also have the word Consulting in VAR3 : 

cristianml_0-1646097444177.png

As you see the problem is that both have CONSULTING and the CONTAINSTRING considers the VAR3 instead to consider V5

 

SG =
VAR V1 = CONTAINSSTRING('_List SG'[Service Group],"APPLICATION OUTSOURCING")
VAR V2 = CONTAINSSTRING('_List SG'[Service Group],"BUSINESS PROCESS OUTSOURCING")
VAR V3 = CONTAINSSTRING('_List SG'[Service Group],"CONSULTING")
VAR V4 = CONTAINSSTRING('_List SG'[Service Group],"INFRASTRUCTURE OUTSOURCING")
VAR V5 = CONTAINSSTRING('_List SG'[Service Group],"STRATEGY CONSULTING")
VAR V6 = CONTAINSSTRING('_List SG'[Service Group],"SYSTEMS INTEGRATION")

RETURN
IF(V1,"AO",
IF(V2,"BPO",
IF(V3,"CON",
IF(V4,"IO",
IF(V5,"SC",
IF(V6,"SI",
"Other"))))))

 

What other way can I use in this case to get the result for a specific sentence or group of words ?

 

Thanks !

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @cristianml 

Don't use CONTAINSSTRING, use = e.g.

 

VAR V3 = IF ( '_List SG'[Service Group] = "CONSULTING", True, False)

VAR V5 = IF ( '_List SG'[Service Group] = "STRATEGY CONSULTING", True, False)

 

Regards

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

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @cristianml 

Don't use CONTAINSSTRING, use = e.g.

 

VAR V3 = IF ( '_List SG'[Service Group] = "CONSULTING", True, False)

VAR V5 = IF ( '_List SG'[Service Group] = "STRATEGY CONSULTING", True, False)

 

Regards

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!


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.