cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nicky Frequent Visitor
Frequent Visitor

How to calculate average for last 8 records in pivot

Hi, I have a pivot table. Can I get the average of the last 13 records for each column?

 

Screenshot_1.png

 

 

Average by per1 column

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User I
Super User I

Re: How to calculate average for last 8 records in pivot

Try this:

Average Last 13 = 
CALCULATE(AVERAGE('Table'[Value]),TOPN(13,VALUES('Table'[min_date]),'Table'[min_date],DESC))

Change the red to match your tables and columns!

 

You can add a matrix with just the columns and the new measure.

View solution in original post

1 REPLY 1
Super User I
Super User I

Re: How to calculate average for last 8 records in pivot

Try this:

Average Last 13 = 
CALCULATE(AVERAGE('Table'[Value]),TOPN(13,VALUES('Table'[min_date]),'Table'[min_date],DESC))

Change the red to match your tables and columns!

 

You can add a matrix with just the columns and the new measure.

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors