>> Download the sample (Power BI)
This sample shows:
(i) The number of new customers
(ii) The number of new customers, factoring in a 1,500-day churn rate
(iii) The number of lost customers (based on a 90-day churn rate, i.e. a lost customer is one who has not made a purchase in the last 90 days)
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales & Customer
Section titled “Measures - Sales & Customer”No. of Distinct Customers
Section titled “No. of Distinct Customers”No. of Distinct Customers =DISTINCTCOUNT ( Sales_Table[Customer] )No. of Lost Customers (based on a 90 Day Churn Rate)
Section titled “No. of Lost Customers (based on a 90 Day Churn Rate)”No. of Lost Customers (based on a 90 Day Churn Rate) =VAR CustomerList = ALL ( Sales_Table[Customer] )VAR ChurnDate = 90RETURN COUNTROWS ( FILTER ( CustomerList, CALCULATE ( COUNTROWS ( Sales_Table ), FILTER ( ALLSELECTED ( Calendar_Table ), Calendar_Table[Date] > ( MIN ( Calendar_Table[Date] ) - ChurnDate ) && Calendar_Table[Date] < MIN ( Calendar_Table[Date] ) ) ) = 0 ) )// on any given day, how many clients would you consider lostNo. of New Customer (factoring in a 1500 Day Churn Rate)
Section titled “No. of New Customer (factoring in a 1500 Day Churn Rate)”No. of New Customer (factoring in a 1500 Day Churn Rate) =VAR CustomerTM = VALUES ( Sales_Table[Customer] )VAR PriorCustomers = CALCULATETABLE ( VALUES ( Sales_Table[Customer] ), FILTER ( ALL ( Calendar_Table ), Calendar_Table[Date] > MIN ( Calendar_Table[Date] ) - 1500 && Calendar_Table[Date] < MIN ( Calendar_Table[Date] ) ) )RETURN COUNTROWS ( EXCEPT ( CustomerTM, PriorCustomers ) )No. of New Customers
Section titled “No. of New Customers”No. of New Customers =VAR Customers = VALUES ( Sales_Table[Customer] )RETURN CALCULATE ( COUNTROWS ( VALUES ( Sales_Table[Customer] ) ), FILTER ( Customers, CALCULATE ( COUNTROWS ( Sales_Table ), FILTER ( ALLSELECTED ( Calendar_Table ), Calendar_Table[Date] < MIN ( Calendar_Table[Date] ) ) ) = 0 ) )Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )Tables
Section titled “Tables”Calendar_Table
Section titled “Calendar_Table”Calendar_Table =GENERATE ( CALENDAR ( DATE ( 2017, 1, 1 ), DATE ( 2019, 12, 31 ) ), VAR currentDay = [Date] VAR Day = DAY ( currentDay ) VAR Month = MONTH ( currentDay ) VAR Year = YEAR ( currentDay ) RETURN ROW ( "Day", day, "Month", month, "Year", year ))