Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi.. Here's an example.
I have a column with strings in it the cell contains text in form of abc_bcd_cba_xyz and I want to count number of times abc, xyz, def occur. so the output should be 2.
Solved! Go to Solution.
Hi, @santpras0
May I ask if you have solved this problem? Depending on your needs you can either try @JamesFR06 's method or try the following.
Measure:
WordCount =
VAR _searchText1 = "abc"
VAR _searchText2 = "xyz"
VAR _targetText =
SELECTEDVALUE ( 'Table'[String] )
VAR _abc =
SUMX ( 'Table', IF ( CONTAINSSTRING ( _targetText, _searchText1 ), 1 ) )
VAR _xyz =
SUMX ( 'Table', IF ( CONTAINSSTRING ( _targetText, _searchText2 ), 1 ) )
RETURN
_abc + _xyz
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @santpras0
May I ask if you have solved this problem? Depending on your needs you can either try @JamesFR06 's method or try the following.
Measure:
WordCount =
VAR _searchText1 = "abc"
VAR _searchText2 = "xyz"
VAR _targetText =
SELECTEDVALUE ( 'Table'[String] )
VAR _abc =
SUMX ( 'Table', IF ( CONTAINSSTRING ( _targetText, _searchText1 ), 1 ) )
VAR _xyz =
SUMX ( 'Table', IF ( CONTAINSSTRING ( _targetText, _searchText2 ), 1 ) )
RETURN
_abc + _xyz
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi
Try this :
testcoptage =
CALCULATE ( COUNTROWS ( Occur ), CONTAINSSTRINGEXACT ( Occur[Column1], "abc" ) )
+ CALCULATE ( COUNTROWS ( Occur ), CONTAINSSTRINGEXACT ( Occur[Column1], "xyz" ) )
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 9 | |
| 8 | |
| 7 |