Forum Discussion

wmcclure's avatar
wmcclure
Helper I
2 years ago
Solved

NPS Score needs additional filter

Hello all!   I have a DAX formula in place for calculating NPS score based on information that customers provide. I need to add some logic to make sure that NPS is only calculated once per customer...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi wmcclure ,

    I apologize for not responding to your message until now.The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a measure

    NPS Score = 
     VAR ResponseCount = COUNTROWS(SUMMARIZE('Table','Table'[uuid]))
     VAR PromoterCount = COUNTROWS(FILTER(SUMMARIZE('Table',[uuid],"Score",MAX('Table'[NPS Score (Our Company Score)])),[Score] >=9))
     VAR DetractorCount = COUNTROWS(FILTER(SUMMARIZE('Table',[uuid],"Score",MAX('Table'[NPS Score (Our Company Score)])),[Score] <= 6))
     VAR Score = IF( ResponseCount >0 ,(0 + (PromoterCount - DetractorCount) / ResponseCount * 100),BLANK())
    
      RETURN IF(NOT(ISBLANK(ResponseCount)), Score)

    2.Final output