Forum Discussion
Running Average is not working.
Hello
3 Replies
- amitchandakSuper 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- Zack92Helper III
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.Below is the file with the changes
https://drive.google.com/file/d/1G8CwOJh_BGUsMUZ41ZUYjzT_cPXvOz9p/view?usp=sharingAgain, thank you so much for your help & time.
- Zack92Helper III
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])))Thank you