Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculate a forcast using a measure from another measure

I have created a monthly index to calculate the last 6 months and a corresponding calculation for the same period last year.

Now I want to use this % as a factor. I want the development  to be constant for the whole 6 months even if I choose to show a graph with sales divided by months.

How can I make this percentage to be 7.86% in this case, although I want to show a graph development of actual sales per month

My goal is to make a forecast based on a (average of the last 2 years) * development last 6 months


Sales forecast =
VAR
SalesLY=calculate('Table - 58248'[Salg totalt],dateadd(DATO[Date],-1,YEAR))
VAR
SalesLY3=calculate('Table - 58248'[Salg totalt],dateadd(DATO[Date],-3,YEAR))
VAR
Factor=1+(Table - 58248'[UTVIKLLING siste 6 mnd i %])
RETURN
divide(Salesly+SalesLY3,2,0)*Factor
 
 
 
SALE LAST 6 months is calculated like this:
Sale last 6 m = SUMX(
    CALCULATETABLE(
        'DATO',
       'DATO'[Last6Months] = 1
    ),
    [Salg totalt]
)
 
 
I find last 6 months like this in my date table:
Last6Months =
VAR TodayMonthIndex =
    CALCULATE (
        MAX ( 'DATO'[MonthIndex] ),
        FILTER ( 'DATO', TODAY () = 'DATO'[Date] )
    )

VAR monthtocheck = 'DATO'[MonthIndex]

RETURN
    IF (
        AND ( monthtocheck >= TodayMonthIndex - 6, monthtocheck < TodayMonthIndex ),
        1,
        0
    )
  • Anonymous's avatar
    Anonymous
    3 years ago

    Here I thought to advanced. It is solved simply by sum a column that has a value based on a If formula.

2 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous ;

    Please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Here I thought to advanced. It is solved simply by sum a column that has a value based on a If formula.