Forum Discussion
Calculate First Sale Date After Web Registration
Hi, I'm trying to calculate the first sale date after a customer registers on our website. This is tricky because a customer may have purchased prior to registering but I only want to return the date of the first sale after the registration.
I've been using the following formula:
First Sale After Reg = CALCULATE( MIN( 'Sales'[SalesDate]), 'Sales'[SalesDate] > 'Sales'[RegistrationDate])
However, using this formula gives me the following error:
"The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression."
How can I make this work?
Thanks! sdickens
Hi sdickens ,
Pls check whether you are missing parentheses in your dax expression.
See my sample below:
Using expression:First Sale After Reg = CALCULATE( MIN( 'Sales'[SalesDate]),filter('Sales', 'Sales'[SalesDate] > 'Sales'[RegistrationDate])) should work.
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
3 Replies
- amitchandak
Super User
sdickens , Try like
First Sale After Reg = CALCULATE( MIN( 'Sales'[SalesDate]),filter('Sales', 'Sales'[SalesDate] > 'Sales'[RegistrationDate]))
- sdickensFrequent Visitor
Hi, Thank you for responding but unfortunately, that didn't work either. I get the following error message:
A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Any other ideas? Thanks
- v-kelly-msft
Community Support
Hi sdickens ,
Pls check whether you are missing parentheses in your dax expression.
See my sample below:
Using expression:First Sale After Reg = CALCULATE( MIN( 'Sales'[SalesDate]),filter('Sales', 'Sales'[SalesDate] > 'Sales'[RegistrationDate])) should work.
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!