Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
sgintowt
Helper I
Helper I

how to calculate customer at risk

Hello

 

I need to calculate customers who had no sales for 30 to 180 days.Have any of you counted customers in a similar way?
I tried with measure but it doesn't count correctly.

 

Lost Customers  =
    VAR CustomersList = DISTINCT(AccountsPerformanceReports[MckAccountId])
    VAR ChurnDate = 30
    RETURN
        COUNTROWS(
                FILTER(
                    CustomersList,
                    CALCULATE( COUNTROWS(AccountsPerformanceReports),
                    FILTER( ALL(Dates),
                    Dates[Date] > (MIN (Dates[Date]) - ChurnDate) && Dates[Date] < MIN(Dates[Date]))) = 0 ))
 
 
Please help
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sgintowt , First create a meausre like

 

Rolling 30 to 180 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ])-30,-150,DAY))

 

Then create a new measure

Risk customer =

countx(values(customer[customer]), if(isblank([Rolling 30 to 180]), [Customer], blank()) )

 

same as lost customer logic

Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@sgintowt , First create a meausre like

 

Rolling 30 to 180 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ])-30,-150,DAY))

 

Then create a new measure

Risk customer =

countx(values(customer[customer]), if(isblank([Rolling 30 to 180]), [Customer], blank()) )

 

same as lost customer logic

Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors