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! Learn more

Reply
Anonymous
Not applicable

Calculating a rolling average for percentages

Hi,

I’m very new to DAX so would appreciate any help on this one!

I have Overall Satisfaction data measured on a scale of 1 (Very dissatisfied) to 7 (Very satisfied). I have bucketed this data by creating a a separate measure for 3 groups: T2B (scores 6&7); M3B (scores 3to5) and B2B (scores 1&2), where the measures are percentages of the total base.

 
Syntax for first measure:
OVERALL CSAT_T2B =
DIVIDE (
CALCULATE ( COUNT ('testdata'[Overall Sat]), 'testdata'[Overall Sat] >= 6 ),
COUNT ('testdata'[Overall Sat] )
)

 

The results for the 3 groups are shown over a 6-month period:Rolling Average for Percentages.PNG

 

 

I want to smooth out the trendlines using a 3-month rolling average. I can create an overall 3-month rolling average based on the actual Overall Satisfaction score but I can’t figure out how to do it based on percentages for each group. Or perhaps there's a different way of calculating the rolling average for percentages? Many thanks!

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

You may research the code generated by Quick measure Rolling average.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks for the suggestion about using a Quick Measure. I had tried that but got an error message 'Only Power BI - provided date hierarchies are supported' (although, using the same Date field in a Month over Month change measure worked.

 

I found the following syntax on another discussion thread:

OVERALL CSAT AVG_3MTH_MA =

CALCULATE (

    AVERAGEX ( 'testdata', 'testdata'[Overall Sat] ),

    DATESINPERIOD (

        'DateKey'[Date],

        LASTDATE ( 'DateKey'[Date] ),

        -3,

        MONTH

    )

)

 

I've used this successfully to create a rolling 3-month average for the score but I can't create the rolling average for the percentage buckets (as described in my first post) correctly. I'm not sure of the syntax I should be using to filter the scores for each bucket. 

 

I'd really appreciate any help on this one! TIA.

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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