Forum Discussion
NJ13
4 years agoHelper I
Count if
Hello All,
I need some help please, I want to calculate using count if for a text column, i have a column with words such as boy ; girl ; child ; family ; And ; model and different other combinations for 34 lines.
I am trying to calculate count if that contains a boy (one of each in the sentence above) and it is not returning any numbers.
thank you for your help!
Hi @ ,
You can create a measure like this:-
Measure = CALCULATE ( COUNT ( 'Table'[Column1] ), CONTAINSSTRING ( 'Table'[Column1], "boy" ) )Thanks,
Samarth
4 Replies
- Samarth_18Community Champion
Hi @ ,
You can create a measure like this:-
Measure = CALCULATE ( COUNT ( 'Table'[Column1] ), CONTAINSSTRING ( 'Table'[Column1], "boy" ) )Thanks,
Samarth
- NJ13Helper I
thank you so much, how about if i want multiple strings?
- Samarth_18Community Champion
You can try like:-
Measure = CALCULATE ( COUNT ( 'Table'[Column1] ), CONTAINSSTRING ( 'Table'[Column1], "boy" ) || CONTAINSSTRING ( 'Table'[Column1], "girl" ) || CONTAINSSTRING ( 'Table'[Column1], "child" )
- NJ13Helper I
Thank you