Forum Discussion

Mr_Glister's avatar
Mr_Glister
Advocate II
7 years ago
Solved

Divide month value by December value

Hi, one to three times each month (random dates each month) my company makes a full year sales volume forecast. As the year proceeds a higher proportion of the full year forecast is made up of actua...
  • Mr_Glister's avatar
    Mr_Glister
    7 years ago

    Hi Lin,

    this is a good start but like I said there can be multiple forecasts per month, also for December.

    So for this we would have to change your formula to the following to sort of fix it. 

    Column = DIVIDE('Table'[Full-year sales volume forecast], CALCULATE(AVERAGE('Table'[Full-year sales volume forecast]),FIL...

    But really, also this isn't correct because I wouldn't want to compare the monthly forecasts with the average of the December forecasts but only with the last one in that month/of the year, which is the actual for the year. If I used the formula as it is above and there are multiple forecasts in December I would see that none of the results in Column are exactly 100%. (If you add another row with a date in December 2018 to the sample data you will understand the problem right away.)

     

    Your suggestion holds the solution to that as well and the final formula has to be:

    Column = DIVIDE('Table'[Full-year sales volume forecast], CALCULATE(SUM('Table'[Full-year sales volume forecast]),FILTER('Table','Table'[Forecast Year]=EARLIER('Table'[Forecast Year])&&'Table'[Forecast Date]=CALCULATE(MAX('Table'[Forecast Date]),FILTER('Table','Table'[Forecast Year]=EARLIER('Table'[Forecast Year]))))))

    Thanks for your help!