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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

50 days Moving Average graph exceeding date values in the column

Hi Team,

This is regarding Moving average measure. we have a date column called short date and values in short date will always be less than or equal to today. But the graph is going beyond today. May be by default it is considering whole calendar year.

 

Formula we used is 

FTE rolling average =

IF(

    ISFILTERED('redmine hyper_automation_program_view'[ShortDate]),

    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),

    VAR __LAST_DATE = LASTDATE('redmine hyper_automation_program_view'[ShortDate].[Date])

    RETURN

        AVERAGEX(

            DATESBETWEEN(

                'redmine hyper_automation_program_view'[ShortDate].[Date],

                DATEADD(__LAST_DATE, -50, DAY),

                __LAST_DATE

            ),

            CALCULATE(SUM('redmine hyper_automation_program_view'[FTE]))

        )

 

The output is:

Rohini_Gande_0-1637906367432.png

Area marked in red should not be appaered in the visual.

 

Thanks in advance!!

 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.If question still not solved ,could you pls share your sample data,and remember to remove confidential data.

 

Best Regards
Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.If question still not solved ,could you pls share your sample data,and remember to remove confidential data.

 

Best Regards
Lucien

VahidDM
Super User
Super User

Hi @Anonymous 

 

Try this:

 

 

 

FTE rolling average =
VAR __LAST_DATE =
    LASTDATE ( 'redmine hyper_automation_program_view'[ShortDate].[Date] )
RETURN
    IF (
        ISFILTERED ( 'redmine hyper_automation_program_view'[ShortDate] ),
        ERROR ( "Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column." ),
        AVERAGEX (
            FILTER (
                ALL ( 'redmine hyper_automation_program_view' ),
                DATESBETWEEN (
                    'redmine hyper_automation_program_view'[ShortDate].[Date],
                    DATEADD ( __LAST_DATE, -50, DAY ),
                    __LAST_DATE
                )
            ),
            [FTE]
        )
    )

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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