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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

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
November Carousel

Fabric Community Update - November 2024

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

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.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.