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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Stan_Lego
Frequent Visitor

I don't know why I cannot use the Rolling Average Quick Measures

I am trying to plot the 7 Day rolling average of CT, but i am unable to do so for some reason using the quick measures. Can anybody help me, will really appreciate it. Thanks!

 

PBI File: https://drive.google.com/file/d/1vRCu6cUpuenbHro2t3TD8E3oa6YRFL7z/view?usp=sharing 

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

Hi, @Stan_Lego ;

If you want to use rolling average base on [CheckInTime] , please try it.

RoLL =
CALCULATE (
    AVERAGE ( [CT] ),
    FILTER (
        ALL ( TrackingTable ),
        DATEDIFF ( [CheckInTime], MAX ( [CheckInTime] ), DAY ) <= 6
            && DATEDIFF ( [CheckInTime], MAX ( [CheckInTime] ), DAY ) >= 0
    )
)

The final output is shown below:

vyalanwumsft_0-1634278374930.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @Stan_Lego ;

I don't quite understand why Averge starts from 0, can you share the results and logic you expect to output?

RoLL = 
CALCULATE(AVERAGE([CT]),FILTER(ALL(TrackingTable),DATEDIFF([CheckOutTime],MAX([CheckOutTime]),DAY)<=6&&DATEDIFF([CheckOutTime],MAX([CheckOutTime]),DAY)>=0))

The final output is shown below:

vyalanwumsft_0-1634535952161.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Stan_Lego ;

If you want to use rolling average base on [CheckInTime] , please try it.

RoLL =
CALCULATE (
    AVERAGE ( [CT] ),
    FILTER (
        ALL ( TrackingTable ),
        DATEDIFF ( [CheckInTime], MAX ( [CheckInTime] ), DAY ) <= 6
            && DATEDIFF ( [CheckInTime], MAX ( [CheckInTime] ), DAY ) >= 0
    )
)

The final output is shown below:

vyalanwumsft_0-1634278374930.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yalanwu-msft 

 

Thank you for your help, i just wanna ask why doesn't the graph start from zero and instead it starts from a particular value. Is it possible to make the graph only calculate rolling average from the first date in the database based on check out?

 

Thanks again for the help

amitchandak
Super User
Super User

@Stan_Lego , with help from date table you should calculate rolling 7 days like

 

example

Rolling = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY))

 

 

Yet to check the file

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Yep I have tried but when it does not show anything when i want to plot it on a line graph

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.