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
TheProv
Frequent Visitor

Cohort Analysis average

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:

TheProv_1-1689603729695.png

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:

TheProv_2-1689603848550.png

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!

1 REPLY 1
Anonymous
Not applicable

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. 

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.