Forum Discussion
Del235
3 years agoHelper III
Count not calculating correctly
I am trying to count text in a column but I'm getting incorrect values. Example: I have two columns
| Visit Date Attendance | Promoter-Detractor |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Detractor |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Neutral |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
| 7/9/2023 0:00 | Promoter |
When I use the formula:
Count of Promoter-Detractor for Promoter =
CALCULATE(
COUNTA('CUSTOMER_FEEDBACK_TABLE'[Promoter-Detractor]),
'CUSTOMER_FEEDBACK_TABLE'[Promoter-Detractor] IN { "Promoter" }
)
I get a count of 23 for Promoter when it should be 11. Why?
19 Replies
- AnonymousNot applicable
Try this one out:
Count of Promoter-Detractor for Promoter =
COUNTROWS(FILTER('CUSTOMER_FEEDBACK_TABLE','CUSTOMER_FEEDBACK_TABLE'[Promoter-Detractor] = "Promoter")) - Del235Helper III
Same result
- AnonymousNot applicable
You're using a DAX measure? That tested successfully for me...
Count of Promoter-Detractor for Promoter = COUNTROWS( FILTER('CUSTOMER_FEEDBACK_TABLE', 'CUSTOMER_FEEDBACK_TABLE'[Promoter-Detractor] = "Promoter" ) )
- Del235Helper III
Is my issue related to the fact that I'm trying to get the count by Date?
- AnonymousNot applicable
Yes, if you're simply looking for a count of rows where the "Promoter-Detractor" has a value of "Promoter" only, use the forumla shared and it will work just fine. You want to filter off of that column, not the date column.
- Del235Helper III
So there are other dates. So I would be counting the number of "Promoters" by date in the column Promotor-Detractor.