Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculation in Data View - Year doesn't change

Hello everyone,

 

this is my first time posting here. I have a data set with 5 tables, it about budget planning and forecasting.
The following table should give an overview about the deadline - when will the budget be used up? (in column "BudgetEnd").
If there is no forecast duration (this is a calculation which depends on another table, so ignore it here), then the value for "ForecastDuration" is empty - means the budget is already used up.

I calculated "BudgetEnd" like this:

DATE(YEAR(Table[Date]), MONTH((Table[Date])+Table[ForecastDurationDays]),DAY(Table[Date]))


The table looks like this (sample):

Order numer | Date               | ForecastDuration Days | ForecastDuration Months | BudgetEnd

56456457      | 01. Aug 2020 |                                                                                   | 01. Aug 2020

83573575      | 01. May 2021 |                  148              |                 5                         | 01. Sep 2021

38757585     |  01. Aug 2021 |                  168              |                                         | 01. Jan 2021

This is my problem -> if the Budget ends in the next year (2022), the year still doesn't change (2021) in my table.

 

What do I have to change in the calculation?

 

Best regards

 

Meri

  • Anonymous's avatar
    Anonymous
    4 years ago

    Anonymous Try this:

    BudgetEnd=DATE(YEAR(Table[Date]), MONTH(Table[Date]),DAY(Table[Date]))+[ForecastDurationDays]

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous Try this:

    BudgetEnd=DATE(YEAR(Table[Date]), MONTH(Table[Date]),DAY(Table[Date]))+[ForecastDurationDays]

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much! Didn't know the solution is that simple 🙂