How to Calculate NPS in Tableau
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.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
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.
- From the top menu in your Tableau worksheet, select Analysis > Create Calculated Field...
- Name the field something clear, like
NPS Grouping. - In the formula box, enter the following logic:
IF [Score] >= 9 THEN "Promoter"
ELSEIF [Score] >= 7 AND [Score] <= 8 THEN "Passive"
ELSE "Detractor"
ENDLet’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.
- Navigate to Analysis > Create Calculated Field... again.
- Name this one
NPS Score. - 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:
- In the Data pane on the left, find your new
NPS Scorecalculated field. - Right-click on it and go to Default Properties > Number Format...
- Choose Percentage from the list.
- 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 Scorefield 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.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
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 Groupingdimension to the "Columns" shelf. - Drag the
Number of Recordsmeasure (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 Groupingonto 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 Scoremeasure 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 Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.