Forum Discussion
Error in DatesinPeriod formula
Nice day
I'm using the datesinperiod metric to calculate the moving sum of 12 months of warehouse parts outputs but it throws me the error
Calculation error in measure 'Metricas'[Salidas12MM]: A date column containing duplicate dates was specified in the call to function 'DATESINPERIOD'. This is not supported
Salidas12MM = Calculate
(sum(TransactionItems[QTY]),
DATESINPERIOD(TransactionItems[OutDate],
MAX(TransactionItems[OutDate]),-12,MONTH))
1 Reply
- johnt75
Super User
When using the time intelligence functions you need to have a properly formatted date table, which has only 1 entry for each day. Set up a date table, mark it as a date table and set up a relationship from the date table to your transactions table and then use columns from the date table in any visuals, filters and formulas.