cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
arth78 Frequent Visitor
Frequent Visitor

Counting occurences in a BIG text field

Hello,

 

I'm a new user of PowerBI and I would like to count the occurences of a word in a single column (which is a big text field).

The difficulty is the field is a real mess... This is an exemple of a SINGLE LINE

 

"25/04/2014 YBE blablabla...

26/01/2009 MPR ras

25/01/2009 MPR blablabla...

18/02/03 STA1: blablabla..."

Yes, this is a single line, and I have thousand like this in my column.

 

My main goal (per example) is to know how many times appear the word "MPR" in the column, and as you can see, there's multiples occurences of "MPR" in a single line.

 

I have tried a lot of things but nothing fit to my specific need...

 

Any help would be appreciated. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mike_honey
Advisor

Re: Counting occurences in a BIG text field

I would calculate this in the Edit Queries window.  I would Add a Custom Column and use a formula like the following:

 

 = List.Count ( Text.Split ( [BIG text field] , "MPR"  ) ) - 1

 

It will split each BIG text field using MPR as a delimiter and then count how many substrings result. 

 

Subtract 1 because Text.Split will always return 1 substring if nothing is found, or 1 more substrings than the number of "hits" you are looking for. 

View solution in original post

1 REPLY 1
mike_honey
Advisor

Re: Counting occurences in a BIG text field

I would calculate this in the Edit Queries window.  I would Add a Custom Column and use a formula like the following:

 

 = List.Count ( Text.Split ( [BIG text field] , "MPR"  ) ) - 1

 

It will split each BIG text field using MPR as a delimiter and then count how many substrings result. 

 

Subtract 1 because Text.Split will always return 1 substring if nothing is found, or 1 more substrings than the number of "hits" you are looking for. 

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 47 members 875 guests
Please welcome our newest community members: