Forum Discussion
Counting words in a column
- 5 years ago
If you use the key phrase column as your row headers in a matrix and create the below measure
Key Phrase Count =CALCULATE( COUNTROWS( PhraseTable))Put the measure in your matrix and that should be good. - Anonymous5 years ago
I don't know if it is possible also in DAX, but using only a function in PQ,
starting from this data table
you can get this result:
Create a measure like below
Key Phrase Count =
CALCULATE (
COUNTROWS ( PhraseTable ),
FILTER ( PhraseTable, CONTAINSSTRING ( PhraseTable[KeyPhrase], "fat cat" ) )
)
Must I write a FILTER line for each phrase? Because I have thousands of different key phrases. The whole point of this is to try to identify what phrases customers use most. Is there a way to programmatically look at each row and see how many times the phrase in it appears in the column, without my having to manually enter the phrase?
Thank you for staying with me as we work through this--
Anne
- Daviejoe5 years agoMemorable Member
Hi Anne,
my apologies, I didn't understand the nature of your request.
I'll get my thinking cap on!
David