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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Zack92
Helper III
Helper III

Running Average is not working.

Hello 

I'm trying to figure out the running average for Open Case Numbers (ones with a status that's not Closed), but I'm totally off. Supposedly, this month should be around 725, but my calculations are nowhere near that. I'm basically trying to track the number of cases piling up (Case Backlog). Can anyone lend a hand or point me in the right direction to get this done?
 
I think I might have figured out where I got stuck. It seems like some of these cases were actually opened a few months back and are still hanging around, not closed yet.
 
Zack92_0-1696558034624.png
Method 1 
RunningAvg 1 =
VAR minimumdate =
    CALCULATE (
        MIN ( df_Case_Running_Test[CreatedDate] ),
        ALL ( df_Case_Running_Test[CreatedDate]  )
    )

VAR totalhour =
    CALCULATE (
        CALCULATE (
            Count ( df_Case_Running_Test[CaseNumber])
        ),
        FILTER (
            ALL ( df_Case_Running_Test[CreatedDate] ),
            df_Case_Running_Test[CreatedDate] >= MIN ( df_Case_Running_Test[CreatedDate])
        )
    )
RETURN
    IF (
        MIN ( df_Case_Running_Test[CreatedDate] ) <= minimumdate,
        Count (df_Case_Running_Test[CaseNumber] ) )
Method 2
3 REPLIES 3
amitchandak
Super User
Super User

@Zack92 , You need try a measure like this with help from date table joined with date of your table

 

Cumm Sales = CALCULATE(AverageX(Values('Date'[Month Year]), CALCULATE(Count(df_Case_Running_Test[CaseNumber]))), filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

 

You can also use window function 

 

Cumm Based on Date = CALCULATE(AverageX(Values('Date'[Month Year]), CALCULATE(Count(df_Case_Running_Test[CaseNumber]))) , Window(1,ABS,0,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))

 

 

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

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 
Hello, I figured out the "Moth Year", but I am getting really high number. Any suggestions as to why is that? 

 

Cumm Sales = CALCULATE(AverageX(Values('Date'[Month]), CALCULATE(Count(df_Case_Running_Test[CaseNumber]))), filter(all('Date'),'Date'[date] <=max('Date'[date])))
 

Zack92_0-1696636884843.png

Thank you 

 

@amitchandak 
Thank you so much for the quick response. So I followed your instructions, created a "Date" table, and joined it to "df_Case_Running_Test". My numbers are really low, I am expecting for the current month around 725 and all other previous months between 600 and 700 average cases. 

Is that because I am missing "[Month Year]" in the formula? How do I add "[Month Year]"
One last question, how do I filter everything case is "Open" not "Closed"? 
Any closed cases should not count toward the average. 

Zack92_0-1696568831249.png

Below is the file with the changes
https://drive.google.com/file/d/1G8CwOJh_BGUsMUZ41ZUYjzT_cPXvOz9p/view?usp=sharing 

 

Again, thank you so much for your help & time. 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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