Forum Discussion

siva_powerbi's avatar
siva_powerbi
Icon for Helper IV rankHelper IV
5 years ago
Solved

subtracting days from Date variable

I am trying to subtract days from date varible that I have calculated in formula but I am getting the error.   An argument of function 'DATE' has the wrong data type or the result is too large or t...
  • AlexisOlson's avatar
    AlexisOlson
    5 years ago

    Zero has the same problem as negative numbers in that there is no zeroth day of the month.

     

    Your column definition is simpler as follows:

    Column 3 =
    VAR firstperiod = "12/28/2020 to 01/24/2021"
    VAR StartDate = DATEVALUE ( RIGHT ( firstperiod, 10 ) )
    VAR FP_ED = StartDate
    VAR FP_SD = StartDate - 27
    VAR SP_SD = FP_SD - 1
    VAR SP_ED = SP_SD - 27
    RETURN
        SP_ED