Forum Discussion
RashmitaR
10 years agoHelper IV
Dax
Hi , I have a dataset with one of its column as date and one more as close price ,I wanted to find the average of close price for the last 7 dates present in my date column for every row.For eg ...
Sean
10 years agoCommunity Champion
RashmitaR This Measure should work... Let me know.
7 Day Avg =
DIVIDE (
CALCULATE (
SUM ( Table[Close Price] ),
DATESINPERIOD ( Table[Date], LASTDATE ( Table[Date] ), -7, DAY )
),
CALCULATE (
DISTINCTCOUNT ( Table[Date] ),
DATESINPERIOD ( Table[Date], LASTDATE ( Table[Date] ), -7, DAY )
),
0
)
- RashmitaR10 years agoHelper IV
Thank you for reply. I have created a column using your suggestion but while creating another one for 15day average i am getting a circular dependency hence i am unable to create it . Could you please help me by letting me know how to deal with this issue .
Thanks ,
Rashmita Reddy.