Skip to main content

Peliqan

Metabase

Customer Churn Rate

SQL query for Metabase

Calculate the customer churn rate.

SELECT COUNT(DISTINCT customer_id) AS total_customers, COUNT(DISTINCT CASE WHEN last_purchase_date < DATE_SUB(NOW(), INTERVAL 30 DAY) THEN customer_id END) AS churned_customers, (COUNT(DISTINCT CASE WHEN last_purchase_date < DATE_SUB(NOW(), INTERVAL 30 DAY) THEN customer_id END) / COUNT(DISTINCT customer_id)) * 100 AS churn_rate FROM tables

Metabase data model

Metabase
Databases

Metabase
Tables

Metabase
Collections

Metabase
Queries

Metabase
Metrics

Metabase
Segments

Metabase
Dashboards

Ready to get instant access to all your company data ?​

Connect 300+ sources, serve any BI tool, and give every AI agent one governed endpoint to read, and write back where the app supports it.