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
Daniel_Derbin
Frequent Visitor

Rolling average for last 24 hours.

Hello All,

I have a case to calculate average of response raet per hour as well as rolling average of response rate on data for last day starting at 12AM.

To deduct response rate i need first to calculate total calls coming into queue as well as calls answered and divide them into percentages.

Total calls =
CALCULATE(
    DISTINCTCOUNT(call_events[call_id]),
        FILTER(call_events, call_events[queue_key] <> BLANK()
    )
)


=========

answered calls =
    CALCULATE(
        DISTINCTCOUNT(call_events[call_id]),
            FILTER(call_events,call_events[dte_speak_start] <> BLANK()),
            FILTER(call_events,call_events[queue_key] <> BLANK())
    )
=====
Response rate =
        DIVIDE([answered calls],[Total calls])

Once i have measure for response rate i calculate average of it per hour:
Average response an hour =
AVERAGEX(
    VALUES(call_events[Hour]),
    [Response rate])

And up until this point all goes well so i can present averages on hourly basis

Daniel_Derbin_0-1684136213840.png


The issue occurs when i try to create measure for rolling average:

Rolling response =
AVERAGEX(
    FILTER(ALLSELECTED(call_events),
        call_events[Hour] <= MAX(call_events[Hour])),
        [Average response an hour])
 
The result in not what i expcected, firstly adding measure to any visual takes several minutes to load, and once it's there it returns with 100% rate

Daniel_Derbin_1-1684136481605.png


i've managed to apply such logic to another KPI where base value (Score) is available in table so no need to calculate it additionally:

Average score = AVERAGE(surveys[score])
========
Average hourly score =
AVERAGEX(
    VALUES(surveys[Hour]),  
    [Average score]
)
===========
Rolling score =
AVERAGEX(
    FILTER(ALLSELECTED(surveys),
    surveys[Hour]<=MAX(surveys[Hour])),
        [Average score]
)
And the result here is satysfying:

Daniel_Derbin_0-1684137017495.png

 


I would appreciate any help.

All best 🙂





1 REPLY 1
lbendlin
Super User
Super User

Your title says "Rolling average for last 24 hours"  but your calculations say different (and they are missing the day filter).  Please clarify.,

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.