# Cohort Analysis - Total Spend

Hi Everyone,

Some of you may have seen the video that Sam shared regarding cohort analysis. I’ll leave a link to the video. In the video he calculated the cohort analysis for retained and churned customers. I’m wondering if anyone can help me figure out how to calculate total spend / instead for each cohort?

Thanks.

To clarify, I’m trying to adapt the formula below for churned customers into something that would calculate total spend. I tried substituting the [Unique Customers] variable with a variable called Total Spend = SUM(Orders[total]), but that did not work. Any clues?

Churned Customers =
VAR CustomerDimension = VALUES( Customers[Customer Names] )

RETURN
IF( SELECTEDVALUE( ‘Cohort Periods’[Period] ) = 0, [Unique Customers],
CALCULATE( [Unique Customers],
FILTER( CustomerDimension,
COUNTROWS(
FILTER( ‘Cohort Periods’,
[Retention Days] > ‘Cohort Periods’[Min Days] && [Retention Days] <= ‘Cohort Periods’[Max Days] ) ) > 0 ) ) )

//main churning formula

Thanks for posting your question @powerbi_jp. To receive a resolution in a timely manner please make sure that you provide all the necessary details on this thread.

Here is a potential list of additional information to include in this thread; demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

Including all of the above will likely enable a quick solution to your question.

Hi @powerbi_jp, we’ve noticed that no response has been received from you since the 22nd of October. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!

Hi @powerbi_jp, due to inactivity, we have tagged this post as SOLVED. If you feel the need to activate the post, we suggest creating a new topic to get a better response from the community. Thanks!