Forum Discussion

MathiasBI's avatar
MathiasBI
Regular Visitor
3 years ago
Solved

Creating calculated columns which show value from four different intervals

Hi!   I'm trying to create four columns that shows four different intervals: Today - 1 month to date 1 month to date - 2 months to date 2 months to date - 3 months to date 3 months to date +++ ...
  • MathiasBI's avatar
    MathiasBI
    3 years ago

    Hi Anonymous ,

     

    I ended up creating variables for the past 1, 2 and 3 months, and equally for 1 month minus 1 day, 2 months minus 1 day etc.. like this:
    Var 1m-1d = Date(Year(TODAY()), Month(TODAY()) - 1, Day(TODAY()-1))

     

    Then I used this formula to calculate the total amount that was due between two dates:

    Due 1m-2m = CALCULATE(SUM([Amount]),DATESBETWEEN([Due Date], [2m before today], [1m-1d after today]))