Forum Discussion

Tomek1982's avatar
Tomek1982
Icon for Helper I rankHelper I
3 years ago

Rolling12 not calculating correctly

Hi,

I have an issue with rolling 12 months calculation which is not working and I do not see the error in the formula. Can anyone support?

 

2 Replies

  • Tomek1982 , if you table do not have date create it using month year

     

    date = date(left([Year/Month],4), right([Year/Month],[Year/Month],2),1)

     

    join date of table with date of date table (or have date key in both YYYYMMDD)

     

    post that try this for rolling 12 measure 

    Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))

    • Tomek1982's avatar
      Tomek1982
      Icon for Helper I rankHelper I

      Hi amitchandak 

      What I found out is that calculation was correct, but the issue is actually with a way the visualisation is done.

      The only difference between those 2 graphs: upper correct and lower not correct is if there is a date or date chierarchy used. Do you know if there is any solution for that?