Forum Discussion

aar21292's avatar
aar21292
Frequent Visitor
3 years ago
Solved

Creating a Forecasting Measure based on latest month measure

Hi I have a measure which calculates turnover accumulation by month, and would like to add a new measure to forecast upcoming months. Ideally what I need is that for incomplete months, my forecast...
  • v-jianboli-msft's avatar
    v-jianboli-msft
    3 years ago

    Hi aar21292 ,

     

    Please Try:

     

    Turnover % Accumulated Forecast = 
    var _a = SUMMARIZE(ALL('Measures Table'),'Measures Table'[Year],'Measures Table'[Month],"Value",[Turnover % Accumulated])
    var _b = MAXX(_a,[Value])
    var _c = CALCULATE(DISTINCTCOUNT('Measures Table'[Month]),FILTER(ALL('Measures Table'),[Year]=SELECTEDVALUE('Measures Table'[Year])&&[Month_Number]<=SELECTEDVALUE('Measures Table'[Month_Number])&&[Turnover %]<>BLANK()))
    var _d = CALCULATE(DISTINCTCOUNT('Measures Table'[Month]),FILTER(ALL('Measures Table'),[Year]=SELECTEDVALUE('Measures Table'[Year])&&[Month_Number]<=SELECTEDVALUE('Measures Table'[Month_Number])))
    return IF(ISBLANK(SELECTEDVALUE('Measures Table'[Turnover %])),DIVIDE(_b,_c)*_d)

     

    Best Regards,

    Jianbo Li

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