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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Shales
Frequent Visitor

Help to amend my Rolling Average calculation.

Hello,

I am looking for some help to tweak a Measure I have that isn't quite working. I am a bit of a novice so I apologies in advance for any incorrect terminolgy or just poor explainations.

My data is Football/Soccer and what I am trying to acheive is having a rolling Average of Goals scored per Player by IndexNumber. All my data is in a table called MatchData1.

I currently have this measure;

4GameGPG measure =
VAR __Index = MAX(MatchData1[Rank])
VAR __MinIndex = __Index - 3
VAR __Table = FILTER(ALLSelected(MatchData1), MatchData1[Rank]<= __Index && MatchData1[Rank] >= __MinIndex)
RETURN
AVERAGEX(__Table,[Goals])​


The measure currently works if I only have 1 person selected in my visual(table). When I select more than 1 person then gives each person the same average for each Rank. I believe I need the Var__Table section of the code to be amended but this is where I am stuck.

Just for reference, here is my Rank DAX;

 

Rank =
VAR d = MatchData1[Date]
VAR c = MatchData1[Players]
RETURN
CALCULATE (
RANK.EQ ( d, MatchData1[Date], Asc ),
FILTER ( ALL ( MatchData1 ), MatchData1[Players] = c )
)


Any help would be really appreciated 🙂.

Thanks,
Gavin

1 REPLY 1
lbendlin
Super User
Super User

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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