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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Tvarberg
Helper I
Helper I

Help with calculating 3 months rolling average

I have below Matrix which is 3 different measures (only below 2 are important)

 

"Cash Out ACT SAP" = Costs month by month

"Cash Out YTD SAP" = Accumulated costs based on first column

 

I want to calculate a forecast that goes into the empty cell/cells for column "Cash Out YTD SAP"

I want to make a forecast base on the last 3 months from "Cash Out ACT SAP"

So, in order to populate 12/1/2023 for "Cash Out ACT SAP" I will take average of (9/1 + 10/1 + 11/1)/3

I then want to PLUS than on "Cash Out YTD SAP" 11/1 to populate 12/1

 

Maybe new columns should be made.

Data.png

Have tried below but returns an error:

Test =
VAR LastDate_ =
    LASTDATE ( 'Date'[Date] )
RETURN(CALCULATE(SUM( 'Date'[Month]), ([Cash Out ACT SAP]  + [Rolling Average 3 months])),
FILTER (
            ALL ('Date'),
            [Date] <= LastDate_
            && [Date] > DATEADD ( LastDate_, -3, MONTH )))
1 REPLY 1
lbendlin
Super User
Super User

Better to use the WINDOW function for that.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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