Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
IMK
Helper I
Helper I

Trying to calculate NPS (Net Promoter Score) via custom calculated column

Hi

 

I am trying to find a correct formula syntax to calculate NPS score (Net Promoter Score).

 

I know how the formula goes in paper but I can't figure out the correct syntax to place in the custom calculated column.

 

Below I will write the calculation. I would appreciate if someone could help me to find the correct formula syntax.

 

I have a column that contains grades given by customers from 0-10. There may be some row's where there is no grade and these row's should not be in the overall calculation.

 

NPS Score Calculation:

 

Example: If you received 100 responses to your survey:

 

10 responses were in the 0–6 range (Detractors)

20 responses were in the 7–8 range (Passives)

70 responses were in the 9–10 range (Promoters)

 

(Number of Promoters — Number of Detractors) / (Number of Respondents) x 100

 

When you calculate the percentages for each group, you get 10%, 20%, and 70% respectively.

To finish up, subtract 10% (Detractors) from 70% (Promoters), which equals 60%. Since an example Net Promoter Score is always shown as just an integer and not a percentage, your NPS is simply 60. (And yes, you can have a negative NPS, as your score can range from -100 to +100.)

 

1 ACCEPTED SOLUTION

I have finally got a working syntax for my needs..

 

Calculating NPS Net Promoter Score using Power BI:

 

When the Column with NPS grades are named "Grades", following works:

 

Modeling -tab -> New Column

 

Column =
IF (
    ISBLANK ( 'Table1'[Grades] );
    "Tyhja";
    SWITCH (
        TRUE ();
        'Table1'[Grades] >= 0
            && 'Table1'[Grades] <= 6; "Detractors";
        'Table1'[Grades] = 7
            || 'Table1'[Grades] = 8; "Passives";
        'Table1'[Grades] = 9
            || 'Table1'[Grades] = 10; "Promoters"
    )
)

Modeling -tab -> New Measure

 

NPS = var NumOfRespon= CALCULATE (
    COUNTA ( Table1[Grades] );
    FILTER ( Table1; Table1[Grades] <> BLANK () || Table1[Grades] = 0 )
)
return 
(CALCULATE(COUNTA(Table1[Respondents]),FILTER('Table1','Table1'[Column]="Promoters"))/NumOfRespon-CALCULATE(COUNTA(Table1[Respondents]),FILTER('Table1','Table1'[Column]="Detractors"))/NumOfRespon) *100

This syntax will ignore all empty cells (rows) in the grades column and do not include empty's in the NumOfRespon which is used as divider for the final NPS score.

View solution in original post

16 REPLIES 16

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.