Forum Discussion
Active Customers by day
I currently count active and unactive customers based on customers who have been in +/- 100 days. My measures only give me a current day view of the active customers. Would it be possible to get a measure of active and unactive by day? Here is my set up:
date table
datekey |
| 1/1/2021 |
| 1/2/2021 |
order table
| order_date | customer_id | product | price | |
| 1/1/2021 | 1 | product a | 100.00 |
customer table
| customer_id | customer name | Last order date | days since |
| 1 | Joe | 1/1/2021 | today()-last order date |
Hi, Anonymous
I'm sorry. I modify the measure.
active = COUNTX ( FILTER ( ALL ( Customers ), Customers[CURRENT last order] >= SELECTEDVALUE ( 'Table'[Date] ) - 100 && [CURRENT last order] <= SELECTEDVALUE ( 'Table'[Date] ) ), [customerID] ) + 0inactive = COUNTX ( FILTER ( ALL ( Customers ), Customers[CURRENT last order] < SELECTEDVALUE ( 'Table'[Date] ) - 100 || [CURRENT last order] > SELECTEDVALUE ( 'Table'[Date] ) ), [customerID] ) + 0Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
16 Replies
- TomMartens
Super User
Hey Anonymous ,
please describe your requirements in more detail and provide sample data that reflects your data model. Use the sample data to explain the expected result.
Regards,
Tom
- AnonymousNot applicable
The main thing I want is to make a table with all dates and a measure to show the active and unactive members at that time period. In this example I would say only have 200 total customers in this time period but every day 1 unactive customer came in so it moved them. Let me know if this helps explain better
- Singaravelu_R
Resolver III
Add the calculated column in the customer table
Active or In active customer = if (DATEDIFF(today(),last order date())=100, "Active Customer","Inactive Customer")
- AnonymousNot applicable
Don't think this would give me historical view of how many active and unactiave I have
- v-janeyg-msft
Community Support
Hi, Anonymous
Can you explain the logic of active and inactive? Is it inactive if you don’t place an order on the same day?
Secondly, Can you share some more sample fake data? So we can quickly help you deal with the problem.
Best Regards
Janey Guo
- AnonymousNot applicable
- v-janeyg-msft
Community Support
Hi, Anonymous
According to your last reply, You need to create a single date list as slicer and create two measure to calculate active and inactive.
Like this:
Table = DISTINCT('Date'[Date])active = COUNTX(FILTER(ALL(Customers),DATEDIFF(SELECTEDVALUE('Table'[Date]),[CURRENT last order],DAY)<=100),[customerID])+0inactive = COUNTX(FILTER(ALL(Customers),DATEDIFF(SELECTEDVALUE('Table'[Date]),[CURRENT last order],DAY)>100),[customerID])+0If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Doesn't look like that will work. If you zoom forward to today, there should be 1 active customer (made order on 3/1/21) and 4 inactive.
- v-janeyg-msft
Community Support
Hi, Anonymous
Did you download my file? Have you used new date column as slicer and use it in table instead of old?
Best Regards
Janey Guo
- v-janeyg-msft
Community Support
Hi, Anonymous
I'm sorry. I modify the measure.
active = COUNTX ( FILTER ( ALL ( Customers ), Customers[CURRENT last order] >= SELECTEDVALUE ( 'Table'[Date] ) - 100 && [CURRENT last order] <= SELECTEDVALUE ( 'Table'[Date] ) ), [customerID] ) + 0inactive = COUNTX ( FILTER ( ALL ( Customers ), Customers[CURRENT last order] < SELECTEDVALUE ( 'Table'[Date] ) - 100 || [CURRENT last order] > SELECTEDVALUE ( 'Table'[Date] ) ), [customerID] ) + 0Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.