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
Anonymous
Not applicable

Help with Moving Average of average measure

Hi,

 i need help with moving average of measure. I am attaching excel file with data and output and also pbix file which have all the data imported

 

Excel File 

pbix File 

 

Thanks in Advance.

1 ACCEPTED SOLUTION

Hi  @Anonymous ,

 

You need to make the following two measures below:

 

4week avg = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALL ( 'fiscal week' );
            'fiscal week'[Date].[Date] <= MAX ( 'fiscal week'[Date] )
                && 'fiscal week'[Date].[Date]
                    >= MAX ( 'fiscal week'[Date] ) - 28
        );
        'fiscal week'[Fiscal Week];
        "@bookRation"; [Book to Bill Ratio]
    )
RETURN
   IF(COUNTX(temp_table;[@bookRation]) < 4; BLANK();  AVERAGEX ( temp_table; [@bookRation] ))

13week avg = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALL ( 'fiscal week' );
            'fiscal week'[Date].[Date] <= MAX ( 'fiscal week'[Date] )
                && 'fiscal week'[Date].[Date]
                    >= MAX ( 'fiscal week'[Date] ) - 91
        );
        'fiscal week'[Fiscal Week];
        "@bookRation"; [Book to Bill Ratio]
    )
RETURN
   IF(COUNTX(temp_table;[@bookRation]) < 13; BLANK();  AVERAGEX ( temp_table; [@bookRation] ))

 

Check PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,

Looking at your pbix, which measure are you working on?

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks for your quick response. I was trying different things so please ignor my measures just bill to book ratio measure is working for simple ratio but moving average of bill to book for 4 weeks and 13 week is not working as per the output sheet in excel.

Hi  @Anonymous ,

 

You need to make the following two measures below:

 

4week avg = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALL ( 'fiscal week' );
            'fiscal week'[Date].[Date] <= MAX ( 'fiscal week'[Date] )
                && 'fiscal week'[Date].[Date]
                    >= MAX ( 'fiscal week'[Date] ) - 28
        );
        'fiscal week'[Fiscal Week];
        "@bookRation"; [Book to Bill Ratio]
    )
RETURN
   IF(COUNTX(temp_table;[@bookRation]) < 4; BLANK();  AVERAGEX ( temp_table; [@bookRation] ))

13week avg = 
VAR temp_table =
    SUMMARIZE (
        FILTER (
            ALL ( 'fiscal week' );
            'fiscal week'[Date].[Date] <= MAX ( 'fiscal week'[Date] )
                && 'fiscal week'[Date].[Date]
                    >= MAX ( 'fiscal week'[Date] ) - 91
        );
        'fiscal week'[Fiscal Week];
        "@bookRation"; [Book to Bill Ratio]
    )
RETURN
   IF(COUNTX(temp_table;[@bookRation]) < 13; BLANK();  AVERAGEX ( temp_table; [@bookRation] ))

 

Check PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix Thank you so much sir.

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
Top Kudoed Authors