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
NingMel
Frequent Visitor

Containsstring command

I'm working on this and I know this is not right.  I think I need to use Containsstring but I never use it before, seeking for some advice.  Essentially I want to count WO with EQ code that has 'PFL' within its code.  EQ code is long and 'PFL' can be included at anypart of it.

 

Number of WOs with EQ contain PFL =

COUNTROWS(
FILTER(
WORK_ORDER, CONTAINS(RELATEDTABLE(EQUIPMENT), EQUIPMENT[EQUIPMENT_CODE],"PFL"
)))
 
Really appreciate some directions here.  Thank you.
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@NingMel , Try like

calculate(COUNTROWS(WORK_ORDER),filter(RELATEDTABLE(EQUIPMENT), containsstring(EQUIPMENT[EQUIPMENT_CODE],"PFL")))

 

or

 

calculate(COUNTROWS(WORK_ORDER),filter((EQUIPMENT), containsstring(EQUIPMENT[EQUIPMENT_CODE],"PFL")))

View solution in original post

2 REPLIES 2
NingMel
Frequent Visitor

@amitchandak Thank you so much, it works!! I use this one:

calculate(COUNTROWS(WORK_ORDER),filter(RELATEDTABLE(EQUIPMENT), containsstring(EQUIPMENT[EQUIPMENT_CODE],"PFL")))

amitchandak
Super User
Super User

@NingMel , Try like

calculate(COUNTROWS(WORK_ORDER),filter(RELATEDTABLE(EQUIPMENT), containsstring(EQUIPMENT[EQUIPMENT_CODE],"PFL")))

 

or

 

calculate(COUNTROWS(WORK_ORDER),filter((EQUIPMENT), containsstring(EQUIPMENT[EQUIPMENT_CODE],"PFL")))

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.

Top Solution Authors