How to Calculate NPS in Tableau

Cody Schneider7 min read

Calculating your Net Promoter Score (NPS) in Tableau is a powerful way to visualize customer loyalty, but it isn't as simple as dropping a single field onto a chart. You first need to teach Tableau how to categorize your survey respondents into Promoters, Passives, and Detractors. This article will guide you through creating the necessary calculated fields and building visualizations to track your NPS from every angle.

What is NPS? A Quick Recap

Before jumping into Tableau, let's quickly review the concept of Net Promoter Score. NPS is a widely-used metric for measuring customer loyalty and satisfaction. It's based on a single question: "On a scale of 0 to 10, how likely are you to recommend our company/product/service to a friend or colleague?"

Based on their response, customers are grouped into three categories:

  • Promoters: Scores of 9 or 10. These are your most loyal and enthusiastic customers.
  • Passives: Scores of 7 or 8. They are satisfied but not necessarily loyal and are vulnerable to competitive offerings.
  • Detractors: Scores of 0 to 6. These are unhappy customers who can damage your brand through negative word-of-mouth.

The NPS formula itself is simple:

NPS = % of Promoters - % of Detractors

The final score is a whole number, not a percentage, ranging from -100 (if every customer is a Detractor) to +100 (if every customer is a Promoter). Now, let’s get this into Tableau.

Preparing Your Data for Tableau

The foundation of any good dashboard is clean, properly structured data. For an NPS analysis, your data only needs to be a simple list of responses. At a minimum, your spreadsheet or database table should have two columns:

  • A unique identifier for each respondent (e.g., Respondent ID, Email, Survey ID).
  • The NPS score they provided (a number from 0 to 10).

For more advanced analysis, like tracking NPS over time or by customer segment, you might also include columns like:

  • Response Date
  • Customer Segment (e.g., Enterprise, SMB)
  • Product Type
  • Country

Your raw data might look something like this in a simple Excel or Google Sheet:

Creating Your 'NPS Group' Calculated Field

Once you connect your data source in Tableau, the first and most important step is to create a calculated field that categorizes each respondent. This field will read each numeric score and assign it a label: Promoter, Passive, or Detractor.

  1. From the top menu in your Tableau worksheet, select Analysis > Create Calculated Field...
  2. Name the field something clear, like NPS Grouping.
  3. In the formula box, enter the following logic:
IF [Score] >= 9 THEN "Promoter"
ELSEIF [Score] >= 7 AND [Score] <= 8 THEN "Passive"
ELSE "Detractor"
END

Let’s break that down:

  • IF [Score] >= 9 THEN "Promoter": If the number in the 'Score' column is 9 or higher, label it as "Promoter."
  • ELSEIF [Score] >= 7 AND [Score] <= 8 THEN "Passive": If the previous condition isn't met, check if the score is between 7 and 8. If so, label it as "Passive."
  • ELSE "Detractor": If neither of the above conditions is true (meaning the score is 6 or less), label it as "Detractor."
  • END: This closes the IF statement.

Click "OK" to save the field. You'll now see 'NPS Grouping' in your Dimensions pane. You can drag this onto your sheet to see a count of each category and confirm it's working properly.

Calculating the Final NPS Score

Now that you have your groups defined, you can write the master formula to calculate the final NPS score. We will create another calculated field that performs the standard (% Promoters - % Detractors) calculation.

Why a new field? This approach keeps your calculations organized. You can use the NPS Grouping field for other charts (like bar charts showing the count of each group), while this new field is dedicated to displaying the final score.

  1. Navigate to Analysis > Create Calculated Field... again.
  2. Name this one NPS Score.
  3. Enter the following formula in the box:
(
  // Count Promoters
  SUM(IF [NPS Grouping] = "Promoter" THEN 1 ELSE 0 END)
  - 
  // Subtract Detractors
  SUM(IF [NPS Grouping] = "Detractor" THEN 1 ELSE 0 END)
)
/ 
// Divide by total number of responses
SUM([Number of Records])

This formula may look complicated, but it's directly recreating the logic (% Promoters - % Detractors). By dividing the difference by the total records at the end, it mathematically achieves the same result in an efficient way for Tableau.

Formatting Your NPS Score for Display

The formula above will return a decimal (e.g., 0.25). To display it correctly as a score like '25', you need to format it:

  1. In the Data pane on the left, find your new NPS Score calculated field.
  2. Right-click on it and go to Default Properties > Number Format...
  3. Choose Percentage from the list.
  4. Set the "Decimal places" to 0.

This tells Tableau to multiply the decimal result by 100 and display it as a clean, whole number that represents your final score.

3 Essential Ways to Visualize NPS in Tableau

With your two calculated fields ready, you can now build a variety of charts to monitor and understand your customer loyalty.

1. The Big Number KPI Card

This is the simplest and most common visual. It’s a large, at-a-glance number showing your current overall NPS.

  • Drag your newly created NPS Score field directly onto the "Text" block inside the Marks card.
  • That's it! Tableau will display the number in the view. You can now resize the view, go to the Text mark, click the three little dots, and edit Font, Size, and Alignment to make it larger and centered.

2. A Bar Chart Breakdown

Understanding the composition of your score is just as important as the score itself. This chart shows you the raw number of Promoters, Passives, and Detractors.

  • Drag the NPS Grouping dimension to the "Columns" shelf.
  • Drag the Number of Records measure (or a distinct count of your Respondent ID) to the "Rows" shelf. Tableau will generate a bar chart.
  • To make it more intuitive, drag NPS Grouping onto the "Color" mark, then click the Color mark to assign appropriate colors (e.g., green for Promoters, red for Detractors, grey for Passives).

3. Tracking NPS Over Time

Is your score improving? You can see the trend with a simple line chart.

  • Make sure your data has a column for the survey response date.
  • Drag your Date dimension to the "Columns" shelf. Right-click it and choose your desired level of detail, like "Month".
  • Drag your NPS Score measure to the "Rows" shelf.

Tableau will automatically create a line chart, showing the fluctuation of your NPS score over time, which is invaluable for spotting trends and measuring the impact of your customer experience initiatives.

Final Thoughts

Learning how to calculate NPS in Tableau is all about using calculated fields to segment survey data into Promoters, Passives, and Detractors. Once you establish this logic, you can easily apply the NPS formula and build insightful visualizations like KPI cards, breakdown bars, and trend lines to get a complete view of customer loyalty.

While building dashboards in Tableau gives you deep configuration options, the initial setup of calculations and views still requires a manual, step-by-step effort. We built Graphed because we believe getting to these insights shouldn't take so much effort. Simply connect your survey data from a file or database, and you can ask in plain English, "show me my NPS score last quarter broken down by customer segment," and get the chart instantly, all without writing a single formula or dragging and dropping fields.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.