Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello,
I have a very simple model;
I want to calculate the distinct number of customers that did a sale in the past, but not in the last 180 days.
As you can see in the following table, customer with id 1 does a second sale on 2019-07-02 and therefore it is the only "returning" customer in my data set;
The result I want to achieve is;
2019-07-02 | 1
In the result, 1 is not the id of the customer, but it means there is only 1 returning customer on this date, which did a sale on this date, does not have a sale in the last 180 days from 2019-07-02, but does have a sale older than 180 days from 2019-07-02.
The following measure is not producing any result;
What is the mistake in my measure?
Many thanks in advance!
@marcorusso wrote a quick measure for something like this: https://community.powerbi.com/t5/Quick-Measures-Gallery/New-and-Returning-Customers/m-p/168297
Thanks! I've seen this before but unfortunately it does not solve my problem. In Marco's example, a returning customer has an easier definition than in my example. My measure contains a mistake in one of the filter arguments which is the reason it does not produce the result I want.
I ended up with the following measure that produces the result I was looking for. As you mentioned on the sqlbi forum, this measure can be improved performance wise, so I will read the article you send me to see if I can implement the suggested performance improvements.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 8 | |
| 8 | |
| 7 |