Forum Discussion
Bug Report: DATESINPERIOD Function – Leap Year Handling
- 1 year ago
Thanks, Greg,
your links are always relevant.
"Unfortunately," I share your opinion about the TI functions, but at the same time, I hope they will be improved and cleaned of their bugs over time. - 1 year ago
A workaround was to propose a month-year selector instead of the date field. This way, you don’t have any issues. I’m reporting the measure for completeness.
var _ultimodelmese =
CALCULATE(
MAX('Data'[data]),
ALLEXCEPT('Data', 'Data'[anno], 'Data'[mese_anno])
)
RETURN
CALCULATE(
[Amount],
DATESINPERIOD(
'Data'[data],
_ultimodelmese,
-1,
YEAR
)
)
Thanks, Greg,
your links are always relevant.
"Unfortunately," I share your opinion about the TI functions, but at the same time, I hope they will be improved and cleaned of their bugs over time.
A workaround was to propose a month-year selector instead of the date field. This way, you don’t have any issues. I’m reporting the measure for completeness.
var _ultimodelmese =
CALCULATE(
MAX('Data'[data]),
ALLEXCEPT('Data', 'Data'[anno], 'Data'[mese_anno])
)
RETURN
CALCULATE(
[Amount],
DATESINPERIOD(
'Data'[data],
_ultimodelmese,
-1,
YEAR
)
)