Forum Discussion
Error 12 Month Rolling SUM
- 6 years ago
Hello mmazzalay
I have seen odd behavior if you use time intelligence functions (DATEADD) without a calendar table that goes from Jan 1st - Dec 31st for all the years in your model.
See if this measure gives any different results
Rolling 12 meses Sales = CALCULATE ( [Sales]; DATESINPERIOD ( TC[Fecha]; MAX ( TC[Fecha] ); -1; YEAR ) )And if not, try adding a calendar table and linking it to your data table and using the dates there which would look something like this.
Rolling 12 meses Sales = CALCULATE([Sales];DATESINPERIOD(calendario[Fecha];MAX(calendario[Fecha]);-1,YEAR))If this solves your issues please mark it as the solution so that others can find it easily. Kudos 👍 are nice too.
John
Hello mmazzalay
I have seen odd behavior if you use time intelligence functions (DATEADD) without a calendar table that goes from Jan 1st - Dec 31st for all the years in your model.
See if this measure gives any different results
Rolling 12 meses Sales =
CALCULATE ( [Sales]; DATESINPERIOD ( TC[Fecha]; MAX ( TC[Fecha] ); -1; YEAR ) )
And if not, try adding a calendar table and linking it to your data table and using the dates there which would look something like this.
Rolling 12 meses Sales = CALCULATE([Sales];DATESINPERIOD(calendario[Fecha];MAX(calendario[Fecha]);-1,YEAR))
If this solves your issues please mark it as the solution so that others can find it easily. Kudos 👍 are nice too.
John
I tried with the first option and it works perfectly!!!😁
Thanks! It was very helpfull!