Forum Discussion

dkotiloglu's avatar
dkotiloglu
New Member
3 years ago

Prev Year FTE Number - Issue with DateAdd

Hi - I would like to calculate the headcount number for the latest actual month and compare it with the same period last year. 
I already calculated the latest actual month headcount and it is working fine however when I try to calculate last year I get the following error 

 

Latest FTE is headcount number of latest actual month and is working fine. I add MAX to DateAdd function cause I would like to look at latest available date and go back 1 year.

I already checked the following;

  1. Headcount Table, Date column is data type: Date/Time
  2. Date columns are linked in Model

  3. I created another measure and assign this to a card 
    MAX('Headcount'[Date]) returns the correct date as seen below (the latest date is Nov 1st in the file) but when I want to go back 1 year via DATEADD, it doesn't work.

I appreciate your support, thanks in advance. 

 

3 Replies

      • FreemanZ's avatar
        FreemanZ
        Icon for Super User rankSuper User

        hi dkotiloglu 

        in your screenshot, it shows the calendar table definition. I meant to change in your PY FTE definition to

        PY FTE=CALCULATE([Latest FTE], DATEADD('Calendar'[Date], -1, YEAR))