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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AG_PBI
Frequent Visitor

Weekly running average

Hi,

I am new to Power BI and this is my first report. I have a dataset as follows:

Loan NumberSubmission WeekVolume
Loan111000
Loan212000
Loan312000
Loan423000
Loan523000
Loan631000
Loan733000
Loan834000
Loan932000

 

In the report dashboard I need to present it like this:

Sub WeekTotal VolumeWeekly Running Avg Vol
150005000
260005500
3100007000

I refeered a few WINDOW function videos, but not able to get the weekly running average. Please suggest.

1 ACCEPTED SOLUTION
AG_PBI
Frequent Visitor

I figured it out. In the RunningSum calculation, it should be ALL('submit') instead of ALL('submit'[Submission Week]). Then it worked. Thanks!

View solution in original post

6 REPLIES 6
Kedar_Pande
Super User
Super User

@AG_PBI 

New Measurs

Total Volume = SUM('YourTableName'[Volume])
Weekly Running Avg Vol = 
AVERAGEX(
DATESINPERIOD(
'YourTableName'[Submission Week],
MAX('YourTableName'[Submission Week]),
-3,
WEEK
),
[Total Volume]
)

This should help you get the desired results in your Power BI report.

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

 

Kedar_Pande
Super User
Super User

@AG_PBI 

New Measurs

Total Volume = SUM('YourTableName'[Volume])
Weekly Running Avg Vol = 
AVERAGEX(
DATESINPERIOD(
'YourTableName'[Submission Week],
MAX('YourTableName'[Submission Week]),
-3,
WEEK
),
[Total Volume]
)

This should help you get the desired results in your Power BI report.

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

 

AG_PBI
Frequent Visitor

I figured it out. In the RunningSum calculation, it should be ALL('submit') instead of ALL('submit'[Submission Week]). Then it worked. Thanks!

Anonymous
Not applicable

Hi @AG_PBI , hello ,rajendraongole1, thank you for your prompt reply!

Congratulations on solving this issue and thanks for sharing your solution.

 

Please remember to accept your solution as answer.

 

It will do great help to those who meet the similar question in this forum.

 

Thanks again for your contribution.

 

AG_PBI
Frequent Visitor

Thanks for your swift feedback. But it is not working as expected. I split the code and found that 'RunningSum' is exactly same as 'Total Volume'. It is just giving the sum of that week itself instead of doing the total with previous week(s).

rajendraongole1
Super User
Super User

Hi @AG_PBI - create a measure for the total weekly volume as below 

Total Volume =
SUM('Table'[Volume])

 

Now create one more measure to calculates the average of all weekly total volumes up to the current submit week.

 

rajendraongole1_0-1730150720312.png

 

Weekly Running Avg Vol =
VAR CurrentWeek = MAX('submit'[Submission Week])
VAR RunningSum =
    CALCULATE(
        SUM('submit'[Volume]),
        FILTER(
            ALL('submit'[Submission Week]),
            'submit'[Submission Week] <= CurrentWeek
        )
    )
VAR WeekCount =
    COUNTROWS(
        FILTER(
            ALL('submit'[Submission Week]),
            'submit'[Submission Week] <= CurrentWeek
        )
    )
RETURN
    DIVIDE(RunningSum, WeekCount)


)
RETURN
DIVIDE(RunningSum, WeekCount)

 

shared the expected output in above snapshot. 

 

Hope it works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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