Forum Discussion

Lobs's avatar
Lobs
Helper II
4 years ago
Solved

Date Add missing a month always

Hi, 

 

So im trying to get the previous month HC data per month, but i keep on missing December as seen below. All the other months align perfectly, am i missing something?

 

I have a measure setup - 

Previous Month HC = calculate(sum('Retention Local 2'[HC_Cur_Mo]),dateadd('Retention Local 2'[Month],-1,MONTH))

 

 

  • Hi Lobs ,

     

    Try to use date table in the dateadd.

    Previous Month HC =
    CALCULATE (
        SUM ( 'Retention Local 2'[HC_Cur_Mo] ),
        DATEADD ( 'calender_table'[date], -1, MONTH )
    )

     

    Thanks,

    Samarth

2 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi Lobs ,

     

    Try to use date table in the dateadd.

    Previous Month HC =
    CALCULATE (
        SUM ( 'Retention Local 2'[HC_Cur_Mo] ),
        DATEADD ( 'calender_table'[date], -1, MONTH )
    )

     

    Thanks,

    Samarth

    • Lobs's avatar
      Lobs
      Helper II

      thank you this worked, just linked my calendar and updated the views, all good now