Forum Discussion

BUK2020's avatar
BUK2020
Frequent Visitor
6 years ago
Solved

Cumulative Forecast

Hi there,

 

I am trying to add a cumulative forecast based on a 1 month rolling average of sales, to create a more accurate representation of the outlook for the next few months. 

 

I have created a 1 month average daily run rate using the following DAX:

 

1 Month Average Daily Run Rate = AVERAGEX(DATESINPERIOD('Date Table'[Date],TODAY(),-1,MONTH),[Selected Measure Value]) where "Selected Measure Value" is Sales Revenue.
 
I then created a cumulative total of this average using the following DAX: 
 
Cumulative Daily Run Rate =
VAR AvgRate = [1 Month Average Daily Run Rate]
 
RETURN
         CALCULATE(
               SUMX( SUMMARIZE('Date Table','Date Table'[Date], "RunRate", AvgRate), [RunRate]),
               FILTER(ALLSELECTED('Date Table'), 'Date Table'[Date] <= MAX('Date Table'[Date])))
 
I then added my YTD Cumulative Revenue measure, my LY Cumulative Revenue measure and my Cumulative Daily Run Rate measure to a line chart, as seen below.
 
My question is; can anyone tell me how i can design this so that the orange line (Cumulative daily run rate) starts where my YTD Cumulative Revenue (Dark Blue) ends, joining the two up. I want it so that where my YTD Cumulative Revenue ends, my 1 month average daily run rate gets added on to that YTD value, cumulatively, see below for table.
 
 

 

The table looks like this (numbers have been changed for confidentiality). As of today (5/5/20), we have sales yesterday but today onwards we do not, hence no revenue on the 5th and 6th May. RR = run rate / **bleep** = cumulative / Rev = Revenue / m = month

 

Date         Revenue      YTD **bleep**. Rev.      1mAvgDayRR       CumRR

4/5/20         50                  3,000                      22                     2,200

5/5/20                                                              22                     2,222

6/5/20                                                              22                     2,244

 

As you can see from the table, my YTD cumulative revenue stops at 3,000 as there are no more sales after the 4th May, but i want to then add the 1mAvgDayRR (1 Month Average Daily Run Rate) value onto that so that on the 5/5/20 i get 3,022, obviously this would have to be done with another measure and hence add another column, that is fine.

 

I hope someone can help because i am sure this can be done someway!

  • Hi BUK2020 ,

     

    We can use the IF function to meet your requirement.

     

    Measure = 
    IF(
        MAX('date table'[Date])<=TODAY(),
    [YTD Cumulative Revenue],[Cumulative Daily Run Rate])

     

    The result like this,

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    Community Support

    Hi BUK2020 ,

     

    We can use the IF function to meet your requirement.

     

    Measure = 
    IF(
        MAX('date table'[Date])<=TODAY(),
    [YTD Cumulative Revenue],[Cumulative Daily Run Rate])

     

    The result like this,

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    Community Support

    Hi BUK2020 ,

     

    How about the result after you follow the suggestions mentioned in my original post?

    Could you please provide more details or expected result about it If it doesn't meet your requirement?

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.