Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Date column + 30 days

Hi,    I have a date column in a fact table; I am wanting to create a calculated column that will list the date that is 30 days from the date.    How do I do this?  
  • v-juanli-msft's avatar
    8 years ago

    Hi Anonymous

    create a calculated column that will list the date that is 30 days from the date

    if leap year; When month is February; [date] + 29 days; else, when month is february; [date] +28 days

    For your requirements, I would suggest as below

    create calculated columns

    Column = IF(DAY(EOMONTH([date],0))=28,28,IF(DAY(EOMONTH([date],0))=29,29,30))
    Column 2 = [date]+IF(DAY(EOMONTH([date],0))=28,28,IF(DAY(EOMONTH([date],0))=29,29,30))

     

     

    Best Regards

    Maggie