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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply

QUARTELY COHORT ANALYSIS?

I have a cohort analysis which is typically montly. 

My boss wants it quarterly. 
I created calculated column to group our customers : 

(DATE) ORDER QUARTER & YEAR =

VAR _FirstOrderDate = CALCULATE(
MIN(orders[time_dropoff_id]),
FILTER(
ALL(orders),
orders[customer_id] = EARLIER(orders[customer_id]) &&
NOT orders[order_status_code] IN {7, 10, 2.5}
)
)
VAR _Year = YEAR(_FirstOrderDate)
VAR _Quarter = QUARTER(_FirstOrderDate)
VAR _MonthEndOfQuarter = _Quarter * 3
VAR _LastDayOfQuarter = EOMONTH(DATE(_Year, _MonthEndOfQuarter, 1), 0)
RETURN _LastDayOfQuarter


I created series that will serve as my column 

Quarter_After = GENERATESERIES( 0, 1000, 1 )


I need DAX where I want know how many from cohort  0 is left quarter by quarter similar to my monthly cohort :


Screenshot 2024-05-03 154859.png



 My monthly cohort retention dax is like this: 


Current Retention Value =
VAR currentMonthsAfter = SELECTEDVALUE('Months after'[Value])
VAR currentfirstordermonth = SELECTEDVALUE( orders[(DATE) FirstOrderMonthYear])

RETURN

    CALCULATE(
        DISTINCTCOUNT( orders[customer_id] ),
        FILTER(
            orders ,
            EOMONTH( orders[time_dropoff_id].[Date] , 0 ) = EOMONTH( currentfirstordermonth , currentMonthsAfter )))
 




1 REPLY 1
Anonymous
Not applicable

Hi @Andrew_na_lang ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.