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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi, I am analyzing a subscription service and I am trying to determine the average for the cohort analysis I have implemented.
I have a subscriptions table that looks as follows:
I determined the join month of a user in another table and generated the following measure:
Customers in cohort % =
VAR CurrentMonthAfter = SELECTEDVALUE('Cohort Analisys'[Value])
VAR CurrentFirstOrderMonth = SELECTEDVALUE('Users'' Revenues & Active Months'[Join month])
VAR _EOMonth = EOMONTH(CurrentFirstOrderMonth, CurrentMonthAfter)
Return
DIVIDE(
Calculate(
DISTINCTCOUNT('subscriptions'[user_id]),
Filter(
'subscriptions',
'subscriptions'[created_at] < _EOMonth && ('subscriptions'[ends_at] = BLANK() || 'subscriptions'[ends_at] > _EOMonth) && _EOMonth < TODAY()
)
),
DISTINCTCOUNT('subscriptions'[user_id])
)
Now, the end result is something like this:
Now, instead of having the join month to build the rows, I'd love to have a single row with the average for the first, second, third month and so on.
Had trouble interpreting other's solution as I'm not a DAX pro.
Thanks in advance for anyone spending time on this!
Hi @TheProv ,
To calculate the average for each month after the join month, you can create a new measure that calculates the average of the "Customers in cohort %" measure for each month. Here's a DAX measure that should help you achieve this:
Average Customers in Cohort % =
VAR MaxMonthAfter = MAX('Cohort Analisys'[Value])
VAR Result =
AVERAGEX(
FILTER(
ALL('Cohort Analisys'[Value]),
'Cohort Analisys'[Value] <= MaxMonthAfter
),
CALCULATE(
[Customers in cohort %],
ALLEXCEPT('Users'' Revenues & Active Months', 'Users'' Revenues & Active Months'[Join month])
)
)
RETURN
Result
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.