The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |