Forum Discussion
RogerSteinberg
Post Patron
6 years agoHow to dynamically select purchases based on a date slicer where the purchase is the first per user
Hi, I have a table full of Purchases per user, per date. The goal is to have a slicer where the user selects a date range and a visual (table/matrix) would display in one column the count of user...
- 6 years ago
Hi RogerSteinberg Please try below. You were missing ALL.
testing_testing = var min_date = CALCULATE( MIN(test[date]), ALLSELECTED(test[date]) ) var customers = values(test[user_id]) var priorcustomers = CALCULATETABLE( VALUES(test[user_id]), FILTER( all(test), test[date] < min_date ) ) return COUNTROWS( EXCEPT( customers, priorcustomers ) )Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.
AnkitBI
Solution Sage
6 years agoHi RogerSteinberg Try below
return
CALCULATE(
[total sales],
filter(test,test[user_id] in EXCEPT(
customers,
priorcustomers
)
))
RogerSteinberg
Post Patron
6 years agoIt stays unfiltered