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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PBDestiny
New Member

Need Measure to check If Item Containsstring then Return Yes or No

I have created this measure, but it is not working.  I'm trying to create a measure that looks at the Item Name field and checks if it contains part of the string "Keysight System".  If yes, then return yes else return no.  What am I doing wrong?

 

Keysight System =
  VAR IsKeysightSystem =
    IF(FILTER(Items, CONTAINSSTRING(Items[Item Name], "Keysight System")), "Yes", "No")
  Return IsKeysightSystem
1 REPLY 1
vicky_
Super User
Super User

If you just want to look at the item name, the SELECTEDVALUE() function works - 

Keysight System =
  VAR IsKeysightSystem =
    IF(CONTAINSSTRING(SELECTEDVALUE(Items[Item Name])"Keysight System"), "Yes", "No")
  Return IsKeysightSystem

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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