Forum Discussion
Find Latest Transaction Date for Each Customer
I have successfully used LASTDATE.
Customer Last Transaction = LASTDATE('Sales'[OrderDate])
Then I populate the rows with the customer ID. My sales table is matched to my customer table using the ID.
kcantor - Hello! Hope you had a good weekend!
I tried LastDate on the Transaction Date Modified - and this is the error I got
A date column containing duplicate dates was specified in the call to function 'LASTDATE'. This is not supported.The current operation was cancelled because another operation in the transaction failed.
If I use this formula on the Calendar Table - no problem
- kcantor10 years ago
Community Champion
That is odd. I use it on a Sales Fact Table that has many duplicates. In fact, I use it on all of my models so that other users know how new the data is.
- Sean10 years ago
Community Champion
heathernicole I have not read the whole post but give this a try...
Last Transaction = CALCULATE ( LASTDATE ( 'Sales Details'[SalesTxnTimeModified] ), ALLEXCEPT ( 'Customer', 'Customer'[Customer Name] ) )- heathernicole10 years ago
Continued Contributor
SeanHad to change SalesTxnTimeModifed to a Date data type. It was orginally a DateTime data type.
I'm thnking that's what caused the issue. :)
On my way to phase 2 of this report. THANK YOU!
kcantor - I believe your solution was correct too - I think the DATETIME was messing it up.