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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello Dear Community,
I have an Orders table, and I need to count the number of active customers.
An active customer is a customer who has purchased at least once within the last quarter.
Here´s a screen shot of the first rows of the Orders table:
And here is a screen shot of the data model:
Could you please help me find out the DAX formula to achieve this calculation?
Many thanks in advance!! 🙂
Hello @tamerj1
Thanks for your quick reply.
You are right, Last Quarter needs to be defined.
To be honest this is an exercise to practise, and I can sort of decide what is considered an active customer.
I thought an active customer should have purchased at least once within the last 3 - 4 months, but that is not what you call a Quarter. I understand your point.
What do you think?
Many thanks in advance!!
@LuisNC
The following shall calculate the number of customers active within 3 months before the selected date.
Active Customers =
VAR Period = 3
VAR EndDate =
MAX ( 'Date'[Date] )
VAR StartDate =
EDATE ( EndDate, - Period )
RETURN
COUNTROWS (
CALCULATETABLE (
VALUES ( Orders[CustomeID] ),
'Date'[Date] <= EndDate,
'Date'[Date] >= StartDate
)
)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |