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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Guruprasad7
Regular Visitor

calculating rolling average or cumulative average

Hi All,

Newbie Here.. 
I'm calculating rolling average using below DAX for a seleceted date range, but not finding the desired output.

Guruprasad7_0-1642684431421.png

Even Tried : 
Calculate(Avgerage(sheet1[RATIO]), Filter(ALL('Table'), 'Table'[Date] <= MAX('Table'[Date]) && 'Table'[Date]>= MIN('Table'[Date])))

Here is the sample raw data and desired output.

Guruprasad7_1-1642685782230.png

If i select date range as May 2021 to Oct 2021, line chart should show 89.19 for may month instead of 91%.

Thank you in advance.

 

Regards,
Guru

2 REPLIES 2
Anonymous
Not applicable

Hi  @Guruprasad7 ,

Do you mean you want to be unaffected by the filter, you can change the Dax to this format:

Create measure.

Measure =
var _1=MAX('Table'[Date])
return
AVERAGEX(
    FILTER(
        SUMMARIZE(ALL('Table'),
        'Table'[Date],
        "Avg value",AVERAGE('Table'[RATIO])),
        'Table'[Date]<=_1),
        [Avg value])

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Vera_33
Resident Rockstar
Resident Rockstar

Hi @Guruprasad7 

 

You have 2 tables, right? [Ration] is in Sheet1, and date slicer is using Table? What is relationship between these two tables? Table is like a Date table? if yes, 1:N relationship with Sheet1, only use to display May - Oct (sample period), then try it, otherwise provide more info and sample data

test = 
VAR CurMax = MAX(sheet1[Date])
RETURN
AVERAGEX(FILTER(ALL(sheet1),sheet1[Date]<=CurMax),sheet1[Ratio])

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors