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

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.

Reply
Anonymous
Not applicable

Should I be using date table columns or fact table in this measure?

Hello Community  -  This measure is from a blog discussing new customers.  Power BI: Cohort Analysis Full Tutorial - Finance BI (finance-bi.com)

 

I've modified it only in terms of I am using (mostly) columns from dimension tables, but in some cases I've used fact tables.  

 

In the original formula, the author has used fact tables.   But I have dimension tables for date and customers.   

 

Any guidance on what to use (and why)?

 

New Customers Average Spend =
VAR acquisitionMonth =
    SELECTEDVALUE ( 'Dim_Order Date Table'[Year Month order] )
VAR selectedFutureMonth =
    SELECTEDVALUE ( 'Future months'[Value] )
VAR currentCustomers =
    VALUES ( 'SalesOrdersALL'[Bill To Customer_CustNum] )
VAR pastCustomers =
    CALCULATETABLE (
        VALUES ( SalesOrdersALL[Bill To Customer_CustNum] ),
        ALL ( 'Dim_Order Date Table'[Month & Year], 'Dim_Order Date Table'[MonthnYear] ),
        'Dim_Order Date Table'[Year Month order] < acquisitionMonth
    )
VAR newCustomers =
    EXCEPT ( currentCustomers, pastCustomers )
VAR customersFuturePeriods =
    CALCULATETABLE (
        VALUES ( SalesOrdersALL[Bill To Customer_CustNum] ),
        ALL ( 'Dim_Order Date Table'[Month & Year], 'Dim_Order Date Table'[MonthnYear] ),
        'Dim_Order Date Table'[Year Month order] = acquisitionMonth + selectedFutureMonth
    )
VAR newCustomersBuyingInFuturePeriods =
    INTERSECT ( newCustomers, customersFuturePeriods )

RETURN
CALCULATE(SUM(SalesOrdersALL[Net Price]),
ALL('Dim_Order Date Table'[Month & Year],'Dim_order date Table'[MonthnYear]),
'Dim_Order Date Table'[Year Month order]= acquisitionMonth+selectedFutureMonth,SalesOrdersALL[Bill To Customer_CustNum]
 IN newCustomersBuyingInFuturePeriods)
/
COUNTROWS(newCustomersBuyingInFuturePeriods)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , refer if this can help

Power BI Cohort Analysis, Customer Retention %- https://youtu.be/qY1SDF1cwsg

 

Period Of Stay – Cohort Analysis: https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-3-Period-Of-Stay-Cohort-Analysis/ba-p/1393410

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amitchandak   Thanks Amit!   What I took away from comparing your video to the measure I used is that I should probably have created my measure using columns from the fact table.  It seems that you created your custom columns in your sales fact table, whereas I created my custom dates in my date dimension table.  

amitchandak
Super User
Super User

@Anonymous , refer if this can help

Power BI Cohort Analysis, Customer Retention %- https://youtu.be/qY1SDF1cwsg

 

Period Of Stay – Cohort Analysis: https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-3-Period-Of-Stay-Cohort-Analysis/ba-p/1393410

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.