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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
cherimjewell67
New Member

Churn Counts Not Working

I'm trying to create a formula for a count of customers where the prior month revenue is >0 and current month revenue is =0. I've tried so many iterations of the same formula I'm seeing stars.

I have 6 categories customers should fall into. The formula is below and works fine.

Churns = SWITCH(TRUE(),
Orders[$ Current Month]>0 && Orders[# Prior Month]<=0, "NEW",
Orders[$ Current Month]=0 && Orders[$ Prior Month]=0, "N/A",
Orders[$ Current Month]<=0 && Orders[$ Prior Month]>0, "CANCEL",
Orders[$ Current Month]=Orders[$ Prior Month], "NO CHANGE",
Orders[$ Current Month]>0 && Orders[$ Prior Month]<Orders[$ Current Month], "UPGRADE",
Orders[$ Current Month]>0 && Orders[$ Prior Month]>Orders[$ Current Month], "DOWNGRADE","")

 

The field for customers is 'Orders'[Customer_Account]
The fields for Current and Prior Month Revenue are measures.

$ Current Month =
CALCULATE(
    SUM('Orders'[Revenue]),DATEADD('Date'[Date],1,MONTH)
    )
AND
$ Prior Month =
CALCULATE(
    SUM('Orders'[Revenue]),DATEADD('Date'[Date],-1,MONTH)
    )
The equation I'm using is:
Cancel =
CALCULATE(
  DISTINCTCOUNT(Orders[Customer_Account]),
  'Orders'[$ Prior Month] > 0),
  'Orders'[$ Current Month] <= 0))
 
I get an error:
A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed. 
I've tried another iteration adding FILTER, I still get an error. 
Here's a small snippet of the data I'm working with.
 
Customer_AccountYear Month$ Current Month$ Prior Month$ DifferenceChurn Status
10000002Feb-24 $2,695($2,695)CANCEL
10000003Feb-24$1,898$4,660($2,762)DOWNGRADE
10000004Feb-24$3,884$3,884$0NO CHANGE
10000005Feb-24$2,703$2,703$0NO CHANGE
10000007Feb-24$3,045$3,045$0NO CHANGE
10000008Feb-24$2,027$2,027$0NO CHANGE
10000009Feb-24$991$991$0NO CHANGE
10000011Feb-24$1,697$1,697$0NO CHANGE
10000012Feb-24$1,500$1,500$0NO CHANGE
10000015Feb-24$1,149$1,149$0NO CHANGE
10000016Feb-24$2,167$2,167$0NO CHANGE

 

Any suggestions would be great! I've checked with Google Gemini and MS CoPilot and nothing has worked.

4 REPLIES 4
v-yilong-msft
Community Support
Community Support

Hi @cherimjewell67 ,

I’d like to acknowledge the valuable input provided by @lbendlin . His initial ideas were instrumental in guiding my approach. However, I noticed that further details were needed to fully understand the issue.  

In my investigation, I took the following steps:

I create a table as you mentioned.

vyilongmsft_0-1714630435058.png

I think you can use IF function.

Status =
IF (
    'Orders'[Differences] = 0,
    "NO CHANGE",
    IF ( 'Orders'[Current] = 0, "CANCEL", "DOWNGRADE" )
)

vyilongmsft_1-1714631585513.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I appreciate these responses, however, I'm trying to count the results of each status by month. Here's what the statuses look like: 

Image A

cherimjewell67_0-1714652711245.png

Here's what I need to create.

Image B

cherimjewell67_1-1714653069230.png

Thank you for all your help!

Hi @cherimjewell67 ,

It looks like there are a lot of unknowns in your .pbix file, could you please upload your .pbix file or more key information for me to research deeper?

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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