Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
HI all, im looking to create a rolling average of the last 6 matches played by a team, so in the data below, what are the average points per game from the last 6, obviously this would be different per team. I can do this in tableau without much fuss, seems to be difficult in power BI, I can share the file if needed, i basically want to show this information on a line graph to help me spot trends
Team Name | Date | Points |
Aberdeen | 04/08/2019 | 3 |
Aberdeen | 11/08/2019 | 0 |
Aberdeen | 24/08/2019 | 1 |
Aberdeen | 31/08/2019 | 3 |
Aberdeen | 14/09/2019 | 1 |
Aberdeen | 21/09/2019 | 3 |
Aberdeen | 28/09/2019 | 0 |
Aberdeen | 05/10/2019 | 1 |
Aberdeen | 19/10/2019 | 3 |
Aberdeen | 27/10/2019 | 0 |
Aberdeen | 30/10/2019 | 3 |
Aberdeen | 02/11/2019 | 3 |
Aberdeen | 09/11/2019 | 3 |
Aberdeen | 24/11/2019 | 1 |
Aberdeen | 30/11/2019 | 3 |
Aberdeen | 04/12/2019 | 1 |
Aberdeen | 07/12/2019 | 0 |
Aberdeen | 14/12/2019 | 3 |
Aberdeen | 21/12/2019 | 0 |
Aberdeen | 26/12/2019 | 3 |
Aberdeen | 29/12/2019 | 1 |
Accrington | 03/08/2019 | 0 |
Accrington | 17/08/2019 | 1 |
Accrington | 20/08/2019 | 0 |
Accrington | 24/08/2019 | 0 |
Accrington | 31/08/2019 | 3 |
Accrington | 07/09/2019 | 1 |
Accrington | 14/09/2019 | 0 |
Accrington | 17/09/2019 | 1 |
Accrington | 21/09/2019 | 1 |
Accrington | 28/09/2019 | 3 |
Accrington | 05/10/2019 | 1 |
Accrington | 12/10/2019 | 0 |
Accrington | 20/10/2019 | 3 |
Accrington | 23/10/2019 | 0 |
Accrington | 26/10/2019 | 0 |
Accrington | 02/11/2019 | 1 |
Accrington | 16/11/2019 | 0 |
Accrington | 23/11/2019 | 3 |
Accrington | 07/12/2019 | 1 |
Accrington | 14/12/2019 | 3 |
Accrington | 21/12/2019 | 1 |
Accrington | 26/12/2019 | 3 |
Accrington | 29/12/2019 | 3 |
Solved! Go to Solution.
Hi @michaeldonnelly ,
try this.
Rolling AVG Points last 6 matches =
CALCULATE (
AVERAGE ( 'Table'[Points] ),
TOPN (
6,
FILTER ( ALLSELECTED ( 'Table'[Date] ), 'Table'[Date] <= MAX ( 'Table'[Date] ) ),
'Table'[Date], DESC
)
)
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Hi @michaeldonnelly ,
try this.
Rolling AVG Points last 6 matches =
CALCULATE (
AVERAGE ( 'Table'[Points] );
TOPN (
6;
FILTER ( ALL ( 'Table'[Date] ); 'Table'[Date] <= MAX ( 'Table'[Date] ) );
'Table'[Date]; DESC
)
)
You may download my PBIX file from here.
Hope this helps.
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
On your file it seems to work perfectly, when I have copied the measure as the table names are all the same, I am getting a different result, which is baffling, I have attached my file
Hi @michaeldonnelly ,
I don't have access to your link.
Please check the authorization.
It should be "Anyone with this link".
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Doesnt seem to want to allow me the option to share without and email from my one drive, so uploaded to dropbox, link below
Hi @michaeldonnelly ,
try this.
Rolling AVG Points last 6 matches =
CALCULATE (
AVERAGE ( 'Table'[Points] ),
TOPN (
6,
FILTER ( ALLSELECTED ( 'Table'[Date] ), 'Table'[Date] <= MAX ( 'Table'[Date] ) ),
'Table'[Date], DESC
)
)
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
you could create a measure like this if I undersyant correct "rolling average"
Measure =
calculate(average(Table1[Points]);TOPN(6;filter(ALL(Table1);Table1[Date]<=SELECTEDVALUE(Table1[Date]) && Table1[Team Name]=selectedvalue('Table1'[Team Name]));Table1[Date];DESC))
do not hesitate to give a kudo to useful posts and mark solutions as solution
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
78 | |
76 | |
53 | |
37 | |
31 |
User | Count |
---|---|
101 | |
56 | |
51 | |
45 | |
40 |