Forum Discussion
DATESBETWEEN ( LASTDATE ( ...
Hi dkwilson ,
Based on the document, the syntax of the DATESBETWEEN function is below.
DATESBETWEEN(<dates>,<start_date>,<end_date>)
The dates should be a reference to a date/time column.
So for your scenario, I'm afraid that your issue is caused by the LAST DATE ( Contracts[Contract End Date] ).
You'd better enter the <date> with a column like DateTime[DateKey] as the document shows.
Normally, if we want to use Time Intelligence functions, we'd better create a calendar table.
Best Regards,
Cherry
Thank you for your reply, v-piga-msft .
I actually do have a separate dates/calendar table.
Basically, I'm trying to write a measure that will return the contract value for current clients whose annual contract ends within the current fiscal year and who have not yet renewed. The problem is, Client A has renewed its annual contract and, therefore, the end date for its latest / most recent contract falls outside the current fiscal year. Its original contract does end within the current fiscal year but I want to exlude Client A from this measure by using the contract end date from its latest / most recent contract.
I hope I've explained myself clearly. My first thought is to find some alternative to a "DATESBETWEEN ( LASTDATE ( ..." filter but I would be grateful for any advice.