Forum Discussion
Mart1980
2 years agoHelper I
Average calculation
Hello ,
I am trying to create a measure that will basically calculate the average of a value for the last 7 days, but this has to be a calculation that every day it calculates the average of 7 days before so I cant have a set start date and end date. Can you please let me know what
that
formula would be?
5 Replies
- Data-estDogResolver IIAvg7Days =Var vDate = DATEVALUE(FORMAT(NOW(), "yyyy-MM-dd"))Var vDateMinus7 = DATEVALUE(FORMAT(NOW() - 7, "yyyy-MM-dd"))var vAvg = CALCULATE(AVERAGE(Sheet2[Value]),Sheet2[Create Date] >= vDateMinus7&& Sheet2[Create Date] <= vDate)Return vAvgIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mart1980Helper I
Thank you for this. would this formula work to calculate the average of another measure ? I have just tried it and its not giving me
the option to add that other measure into the formula
- vanessafvgCommunity Champion
that is why its best to share your data, so that the correct solution can be given.
- vanessafvgCommunity Champion
please provide an sample of what your data looks like, in text format.