Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Count distinct values as a measure

I have column of NPS Score from 1-10. I am trying to group them as detractor (1-6), Passive(7-8) and Promoter(9-10) in a measure. Then I want to display is pie chart. I have this: 

Detractor = CALCULATE(COUNT('Aug'[NPS] < 7)) but it says count accepts a column reference as an argument.
AT the same time, I need to count only distinct user ID.
 
Thanks
~Nita
  • Jimmy801's avatar
    Jimmy801
    5 years ago

    Hello Anonymous 

     

    then try this

     

    Measure = CALCULATE(DISTINCTCOUNT('Aug'[name] ),filter('Aug','Aug'[NPS] <7))

     

    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy

4 Replies

  • Jimmy801's avatar
    Jimmy801
    Community Champion

    Hello Anonymous 

     

    try this

     

    Measure = CALCULATE(count('Aug'[NPS] ),filter('Aug','Aug'[NPS] <7))


    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Jimmy, this kind of meets my need. I have another ID column. I want to count on the values of NPS for distinct ID values only!

      • Jimmy801's avatar
        Jimmy801
        Community Champion

        Hello Anonymous 

         

        then try this

         

        Measure = CALCULATE(DISTINCTCOUNT('Aug'[name] ),filter('Aug','Aug'[NPS] <7))

         

        If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
        Kudoes are nice too

        Have fun

        Jimmy