cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bbwong
Frequent Visitor

Containstring Function

Hi,

 

Needing help with a formula to calculate the Level of Support containing text of "high intensity" or "standard", with remaining categorized as "Other".

 

ServiceLevel of Support (calcaulate column) if contains:
Support with High IntensityHigh Intensity
Standard SupportStandard
Service Add 1Other
Service Add 2Other
Service Add 3Other

 

With thanks,

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@bbwong Maybe:

Column =
  SWITCH(TRUE(),
    SEARCH("High Intensity",[Service]),"High Intensity",
    SEARCH("Standard",[Service]),"Standard",
    "Other"
  )

@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop!
Microsoft Hates Greg's Quick Measures
Check out my latest book!

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@bbwong Maybe:

Column =
  SWITCH(TRUE(),
    SEARCH("High Intensity",[Service]),"High Intensity",
    SEARCH("Standard",[Service]),"Standard",
    "Other"
  )

@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop!
Microsoft Hates Greg's Quick Measures
Check out my latest book!

View solution in original post

Thanks for the prompt reply.

I tried the above however getting an error of:
Function 'SWITCH' does not support comparing values of type True/False with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.

bbwong
Frequent Visitor

Managed to tweek your suggestion and it worked!
 

 

Column =
  SWITCH(TRUE(),
    SEARCH("High Intensity",[Service]) 1, 0 ) > 0,"High Intensity",
    SEARCH("Standard",[Service]) 1, 0 ) > 0,"Standard",
    "Other"
  )

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!