cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NaifO
New Member

How to count particular word in column contains string

Greetings all, 

 

if I would count String in a column that contains a particular word using the measure 

for example, a column contains the full name and I would calculate how many Jeff we have? regardless if is it first or family name 

1 ACCEPTED SOLUTION
nvprasad
Solution Specialist
Solution Specialist

Hi NaifO,

 

You can get count with the below measure. 🙂

 

JeffCount = COUNTX(FILTER('Table',CONTAINSSTRING('Table'[ColumnName],"Jeff")),1)
 
 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

View solution in original post

3 REPLIES 3
NaifO
New Member

It worked fine, but could you illustrate why you put number 1 

JeffCount = COUNTX(FILTER('Table',CONTAINSSTRING('Table'[ColumnName],"Jeff")),1)

 

and thank you for your quick reply

Reference to COUNTX()

https://docs.microsoft.com/en-us/dax/countx-function-dax

 

A more robust solution is

= COUNTROWS ( FILTER ( 'Table', CONTAINSSTRING ( 'Table'[ColumnName], "Jeff" ) ) ) + 0
nvprasad
Solution Specialist
Solution Specialist

Hi NaifO,

 

You can get count with the below measure. 🙂

 

JeffCount = COUNTX(FILTER('Table',CONTAINSSTRING('Table'[ColumnName],"Jeff")),1)
 
 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.