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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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 Sage
Solution Sage

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

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

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

CNENFRNL
Community Champion
Community Champion

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

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

nvprasad
Solution Sage
Solution Sage

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

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.