Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
)
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 12 | |
| 10 | |
| 8 |