Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
I am loolking to create an IF statement for customer churn based on 3,6,9 months. Examaple below:
IF, 3 months with 0 Rev, then"At Risk 1"
IF, 6 months with 0 Rev, then"At Risk 2"
IF, 9 months with 0 Rev, then"At Risk 3"
IF, OVER 9 months with 0 Rev, then"Churned Customer"
@Anonymous , Please try below formula to calulate revenue and categorize it
CustomerChurnStatus =
VAR CustomerID = 'YourTableName'[CustomerID] -- Replace 'YourTableName' with the actual name of your table
VAR CurrentDate = TODAY()
-- Calculate total revenue for the last 3, 6, and 9 months for the customer
VAR RevenueLast3Months =
CALCULATE(SUM('YourTableName'[Revenue]), FILTER('YourTableName', 'YourTableName'[CustomerID] = CustomerID && 'YourTableName'[Date] >= CurrentDate - 90 && 'YourTableName'[Date] < CurrentDate))
VAR RevenueLast6Months =
CALCULATE(SUM('YourTableName'[Revenue]), FILTER('YourTableName', 'YourTableName'[CustomerID] = CustomerID && 'YourTableName'[Date] >= CurrentDate - 180 && 'YourTableName'[Date] < CurrentDate))
VAR RevenueLast9Months =
CALCULATE(SUM('YourTableName'[Revenue]), FILTER('YourTableName', 'YourTableName'[CustomerID] = CustomerID && 'YourTableName'[Date] >= CurrentDate - 270 && 'YourTableName'[Date] < CurrentDate))
RETURN
IF (
RevenueLast3Months = 0,
"At Risk 1",
IF (
RevenueLast6Months = 0,
"At Risk 2",
IF (
RevenueLast9Months = 0,
"At Risk 3",
IF (
RevenueLast9Months > 0,
"Active Customer",
"Churned Customer"
)
)
)
)
Accept as solution and give kudos if it helps
Proud to be a Super User! |
|
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 14 |