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 August 31st. Request your voucher.

Reply
novieee
Frequent Visitor

How to get the trailing 4 weeks of this

I tried the solution from other threads in forum but it cant seem to work with mine. I want to get the trailing 4 weeks of my Actual, this actual is in MEASURE, here is the formula for that 

Actual =
IF(
    SELECTEDVALUE(CalendarTable[YearNum]) >= 2016 && SELECTEDVALUE(CalendarTable[YearNum]) <= 2021,
    DIVIDE(
        [sumLossStandardChangeToolFreq],
        (DIVIDE([SumAvailableTime], (8 * 60)) / 10)
    ),
    DIVIDE([sumLossStandardChangeToolFreq],[sumNumberOfShift]) * 10
)

novieee_0-1688027656996.png I thought I solved this one, but when I checked it again it isnt showing any output here is the formula of my trailing 4 weeks average 

Trailing 4 Weeks =
VAR MaxDate = MAX('CalendarTable'[Date])
RETURN
    AVERAGEX(
        FILTER(
            ALL('CalendarTable'),
            'CalendarTable'[Date] >= MaxDate - 27 && 'CalendarTable'[Date] <= MaxDate
        ),
        [Actual]
    )

The 2016 - 2021 is summarize month thats why its like that 
novieee_1-1688027781669.png

And I dont want it to be included in getting the Trailing 4 weeks averages

I hope someone can help me. Thank you!

 

 

3 REPLIES 3
novieee
Frequent Visitor

This is my expected results 

novieee_0-1688028123418.png

that is in excel, that is for total of all the lines, there is also for individual.

 

 

First ff

novieee
Frequent Visitor

I have a calendar table

novieee_0-1688027856045.png

 this is the formula I used for that. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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