Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nokhse
New Member

Rolling 3 month average Run Rate to forecast rest of year

HI 

New enough to BI and running into a few problems in doing some forecasting.

Say i have 3 months actuals per Month

Jan   10

Feb 20

 Mar 25

I want to forecast per month for the rest of the year which will be the sum of the above 3 months divided by the number of days in those months (90days) and multiplied out for each month

Apr - (10+20+25)/(31+28+31)* 30 days in April 

May (10+20+25)/(31+28+31)* 31 days in May etc etc

I can calculate the Actuals for the 3 months but cant do anything else!!!

thanks

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @nokhse,

You can try to use the following measure formula to calculate the rolling average for the three months:

formula =
VAR currDate =
    MAX ( Table[Date] )
VAR prevDate =
    DATE ( YEAR ( currDate ), MONTH ( currDate ) - 2, 1 )
VAR endDate =
    DATE ( YEAR ( currDate ), MONTH ( currDate ) + 1, 1 ) - 1
RETURN
    DIVIDE (
        CALCULATE (
            SUM ( Table[Value] ),
            FILTER ( ALLSELECTED ( Table ), [Date] >= prevDate && [Date] <= endDate )
        ),
        COUNTROWS ( CALENDAR ( prevDate, endDate ) )
    )
        * DAY ( endDate )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @nokhse,

You can try to use the following measure formula to calculate the rolling average for the three months:

formula =
VAR currDate =
    MAX ( Table[Date] )
VAR prevDate =
    DATE ( YEAR ( currDate ), MONTH ( currDate ) - 2, 1 )
VAR endDate =
    DATE ( YEAR ( currDate ), MONTH ( currDate ) + 1, 1 ) - 1
RETURN
    DIVIDE (
        CALCULATE (
            SUM ( Table[Value] ),
            FILTER ( ALLSELECTED ( Table ), [Date] >= prevDate && [Date] <= endDate )
        ),
        COUNTROWS ( CALENDAR ( prevDate, endDate ) )
    )
        * DAY ( endDate )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Follow up Question: how to get it for the rest of the year? or Next 18 months?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.