Forum Discussion
counting text values from a column
- 2 years ago
Anonymous .
First thing is you want to use COUNTA (used to Count Text Values) not DISTINCTCOUNT. The way you are using DistinctCount will always give a 1.
Next, in your Filter context, it is looking for an exact string. Your text value contains a semi-colon and hence PBI is saying it is not a match. To account for this, use CONTAINSSTRING:
Containsstring = CALCULATE( COUNTA( ExitInterviews[Reason] ), FILTER( ExitInterviews, CONTAINSSTRING( ExitInterviews[Reason], "Job/Role" )))The other thing you may want to consider is using Power Query to split your Columns by Delimiter. Use the advanced functions to "Split into Rows". Then you get all your Reasons individually by Row.
Hope this helps.
Regards,
Anonymous .
First thing is you want to use COUNTA (used to Count Text Values) not DISTINCTCOUNT. The way you are using DistinctCount will always give a 1.
Next, in your Filter context, it is looking for an exact string. Your text value contains a semi-colon and hence PBI is saying it is not a match. To account for this, use CONTAINSSTRING:
Containsstring = CALCULATE( COUNTA( ExitInterviews[Reason] ),
FILTER( ExitInterviews, CONTAINSSTRING( ExitInterviews[Reason], "Job/Role" )))
The other thing you may want to consider is using Power Query to split your Columns by Delimiter. Use the advanced functions to "Split into Rows". Then you get all your Reasons individually by Row.
Hope this helps.
Regards,
- Anonymous2 years agoNot applicable
It worked, thank you for the explanation! 🙂