Forum Discussion
7 Day Moving Average not working correctly
- 7 years ago
Hi Anonymous,
It looks like a context issue. If you put the [GasProduction(sum)] and the [Rolling 7 day SUM] along with the [Production Date], I think you will get the right result.
I would still suggest you create a date table. The dates in the visual will be from this table.
Calendar = calendar(date(2010, 1,1), date(2019, 12, 31))
Best Regards,
Hi Anonymous,
Firstly, the datesinperiod-function-dax is a time intelligence function that needs a continuous date table.
Secondly, the dates in the formula are [Record Date] while it's [Date] in the visual. That could cause an issue.
Can you share a sample file, please? Please mask the sensitive parts first.
Best Regards,
Here is my sample data. Where i am getting proper ouput from import method and Live connection i am calling this measure from cube. Due to this it is not giving desired output.
Input:
| Measure | Date |
| 449.3890785 | 12/31/2018 0:00 |
| 449.378157 | 12/30/2018 0:00 |
| 461.4709898 | 12/29/2018 0:00 |
| 463.4600683 | 12/28/2018 0:00 |
| 473.487372 | 12/27/2018 0:00 |
| 466.3945392 | 12/26/2018 0:00 |
| 482.465529 | 12/25/2018 0:00 |
| Required Result | |
| Measure | Date |
| 463.7208191 | 12/31/2018 0:00 |