Customer Churn Rate Calculator
Tableau Calculated Field Formula:
How to Calculate Churn Rate in Tableau
Customer Churn Rate is one of the most critical metrics for SaaS companies, subscription services, and any business relying on recurring revenue. It represents the percentage of customers who discontinue their service over a specific time period. While the mathematical concept is straightforward, implementing it dynamically in Tableau requires understanding both the logic and the specific functions available in the software.
The calculator above allows you to quickly verify your manual calculations before building complex dashboards. Below, we detail how to translate this logic directly into Tableau Calculated Fields.
The Core Formula
Before opening Tableau, it is essential to understand the math. The standard formula for churn rate is:
Step-by-Step: Calculating Churn in Tableau
In Tableau, you rarely have a simple column labeled "Customers Lost." You usually have transaction data or start/end dates for subscriptions. Here is how to approach the calculation using Calculated Fields.
Method 1: Using Aggregated Data
If your dataset already contains summary rows for each month (e.g., a row saying "Jan 2023", "500 Starts", "25 Cancelled"), the calculation is simple.
- Navigate to Analysis > Create Calculated Field.
- Name the field "Churn Rate".
- Enter the formula:
SUM([Customers Lost]) / SUM([Customers at Start]). - Right-click the new field in the Data pane, go to Default Properties > Number Format, and select Percentage.
Method 2: Determining Churn from Row-Level Data
Most datasets are at the customer level, containing a [Start Date] and an [End Date] (which is null if the customer is still active). To calculate churn for a specific month using Level of Detail (LOD) expressions or simple logic:
1. Identify Active Customers:
Create a calculated field to determine if a customer was active at the start of the period.
IF [Start Date] = [Period Start]) THEN 1 ELSE 0 END
2. Identify Lost Customers:
Create a calculated field to flag customers who left during the period.
IF [End Date] >= [Period Start] AND [End Date] <= [Period End] THEN 1 ELSE 0 END
3. Final Calculation:
Combine these into your final ratio.
SUM([Lost Customers]) / SUM([Active Customers at Start])
Visualizing Churn in Tableau
Once you have created your calculated field, visualizing it effectively is the next step to providing actionable insights.
- Line Charts: The most common way to view Churn Rate over time. Place your "Order Date" or "Month" in the Columns shelf and your new "Churn Rate" calculated field in the Rows shelf.
- Cohort Analysis: Use a highlight table to show churn rates based on when the customer first signed up. This helps identify if newer customers are churning faster than older ones.
- Dual Axis: Plot "Total Active Customers" as bars and "Churn Rate" as a line on the secondary axis to see the correlation between growth and attrition.
Why Your Tableau Calculation Might Returns Errors
If you see "Cannot mix aggregate and non-aggregate arguments," you are likely trying to divide a sum by a row-level value. Ensure you wrap your fields in SUM() or COUNTD() (Count Distinct) to ensure the numerator and denominator are at the same level of aggregation.
Example correction: Change [Customers Lost] / [Total Customers] to SUM([Customers Lost]) / SUM([Total Customers]).