Forum Discussion
DATEDIFF syntax error in measure.
- 8 years ago
Hi,
Does this work?
=DATEDIFF(MAX(Data[VacDate]),TODAY(),Month)
Hello Ashish,
Your suggestion DID work with some small modifications. Thank you for your time.
I am curious about the following - This is what finally worked.
(My new Measure) Since last Vac = DATEDIFF(MAX(Sheet1[VacDate]),TODAY(),Month)
This also worked in a new column:
(New Column) Since last Vac = DATEDIFF([VacDate],NOW(),Month)
But the same but if swap that code between the column and measure is doesnt work. Any idea why?
You are welcome. In a calculated column formula, [VacDate] picks up the value in the current row of that column column. In a measure, when you mention [VacDate], it refer to all entries in that column. To get it to refer to the current row, we use the MAX function.