Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |