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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Bryanna
Helper II
Helper II

rolling past 3 month average

Hi,

 

I am trying to do a rolling past 3 month average so i can create a goal for my ordering volume but i need this to be able to be drilled up or down at the day, month,year level within a visual. 

 

Any thoughts?

 

Thanks!

 

3 REPLIES 3
Bryanna
Helper II
Helper II

@Greg_Deckler 

 

So i tried using this but this is at the month level I need it at the day level. 

Better Rolling Average =
    VAR __EndDate = MAX('KPI Scorecard'[DTE])
    VAR __3MonthsAgo = EOMONTH(__EndDate, -3)
    VAR __StartDate = DATE(YEAR(__3MonthsAgo), MONTH(__3MonthsAgo), 1)
    VAR __Table =
        SUMMARIZE(
            FILTER(ALL('KPI Scorecard'),[DTE]>=__StartDate && [DTE]<=__EndDate),
            'Calendar Table'[Month],
            "__Value",([Domestic Lines Shipped])
        )
RETURN
    AVERAGEX(__Table,[__Value])
 
 
I also have this that does it at the day level but the total still is an average. Is there a way i can take this measure so when i drill up or down on a visual that it has the average by day but then sums those averages for the entire month and then quarter, year etc.
29 = var maxdate = MAX('Calendar Table'[Date])
var s = CALCULATE('KPI Scorecard'[Domestic Lines Shipped],
DATESINPERIOD('Calendar Table'[Date], maxdate,-90, day),
ALL('Calendar Table'[Date]))
var e = s/90
return e*DISTINCTCOUNT('Calendar Table'[Weekday number])

@Bryanna That's a different issue. First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8

 

Also: Matrix Measure Total Triple Threat Rock & Roll - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Bryanna See if this helps: Better Rolling Average - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.