Forum Discussion
rflipper
7 years agoFrequent Visitor
MRR Churn calculation
Hello! I have a simple model with the following structure: Date | Subs | Income I have the following code to calculate MRR for new customers. MRRNew =
IF(
ISFILTERED('transactions'[...
AlB
7 years agoCommunity Champion
Hi rflipper
If the measure that you show is correct (I haven't checked it thoroughly) the MRR for churned customers is almost the same, you just have to invert the arguments in the final EXCEPT:
EXCEPT( __EXISTING_VALUES;__CURRENT_VALUES)
with these you'd be taking the customers present last month that are not present this month. That's the churners as you very well have said. I'd probably more self-explanatory names for the vars though. 'Existing' and 'Current' values are a bit confusing but well that's actually a matter of taste.
MRRNew =
IF(
ISFILTERED('transactions'[Date]);
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
VAR __CURRENT_VALUES = SUMMARIZE(VALUES('transactions'); 'transactions'[Subs])
VAR __EXISTING_VALUES =
CALCULATETABLE(
SUMMARIZE(VALUES('transactions'); 'transactions'[Subs]);
FILTER(
ALL('transactions'[Date].[Date]);
'transactions'[Date].[Date] < MIN('transactions'[Date].[Date])
);
KEEPFILTERS(__CURRENT_VALUES)
)
RETURN
CALCULATE(
SUM('transactions'[Income]);
EXCEPT( __EXISTING_VALUES; __CURRENT_VALUES )
)
)