Forum Discussion

Del235's avatar
Del235
Helper III
3 years ago

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 AttendancePromoter-Detractor
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter
7/9/2023 0:00Detractor
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter
7/9/2023 0:00Neutral
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter
7/9/2023 0:00Promoter

 

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Try this one out:

     

    Count of Promoter-Detractor for Promoter =
    COUNTROWS(
        FILTER('CUSTOMER_FEEDBACK_TABLE',
        'CUSTOMER_FEEDBACK_TABLE'[Promoter-Detractor] = "Promoter"
        )
    )
    • Anonymous's avatar
      Anonymous
      Not 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"
          )
      )

       

       

       

  • Is my issue related to the fact that I'm trying to get the count by Date?

    • Anonymous's avatar
      Anonymous
      Not 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. 

      • Del235's avatar
        Del235
        Helper III

        So there are other dates.  So I would be counting the number of "Promoters" by date in the column Promotor-Detractor.