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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
michael_knight
Post Prodigy
Post Prodigy

Previous 3 Months Average

Hi,

 

I'm trying to create a measure which will display the average of the last 3 months

 

%.PNG

 

This is what I want is have as a average over the last 3 months. For example, April's % will be an average of April, March and February. January's % will be January 2021, Demember 2020 and November 2020 etc

 

I tried searching on the forums and came accross this piece of code 

3 Month Rolling Average Fall Through = 
var threeos = CALCULATE (
    AVERAGEX ( VALUES ( 'Date'[Month/Year] ), [Confirmed]),
    DATESINPERIOD ( 'Date'[Full Date], MAX ( 'Date'[Full Date] ), -3, MONTH )
)

var threewith = 
CALCULATE (
    AVERAGEX ( VALUES ( 'Date'[Month/Year] ),[Fall Through]),
    DATESINPERIOD ( 'Date'[Full Date], MAX ( 'Date'[Full Date] ), -3, MONTH )
)

return

IFERROR(threewith/threeos, BLANK())

This results in what it looks the next 3 months rather than the previous so I don't think that's right. Here's a screenshot

% 2.PNG

 

I'm struggling which is why I came here

 

Here's the PBIX: https://www.dropbox.com/s/4pbc79tpo9yg59a/help.pbix?dl=0

 

Any questions let me know

 

Cheers,

Mike

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @michael_knight 

 

Pleases try the below measure.

 

3 Month Rolling Average Fall Through =
IF (
ISBLANK ( [Confirmed] ),
BLANK (),
CALCULATE (
AVERAGEX ( VALUES ( 'Date'[Month/Year] ), [Fall Through %] ),
DATESINPERIOD ( 'Date'[Full Date], LASTDATE ( 'Date'[Full Date] ), -3, MONTH )
)
)

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @michael_knight 

 

Pleases try the below measure.

 

3 Month Rolling Average Fall Through =
IF (
ISBLANK ( [Confirmed] ),
BLANK (),
CALCULATE (
AVERAGEX ( VALUES ( 'Date'[Month/Year] ), [Fall Through %] ),
DATESINPERIOD ( 'Date'[Full Date], LASTDATE ( 'Date'[Full Date] ), -3, MONTH )
)
)

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Fantastic, thank you @Jihwan_Kim 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors