I am new to PowerPivot and DAX functions and I want to calculate a moving average of a variable in last 5 minutes. Can anybody shed some light on this? I attached a screenshot to show the data structure. Data Structure.png
I am new to PowerPivot and DAX functions and I want to calculate a moving average of a variable in last 5 minutes. Can anybody shed some light on this? I attached a screenshot to show the data structure. Data Structure.png
Hi,
The lack of response is no doubt because you chose to upload a picture rather than your workbook (contrary to the forum guidance in the rules)
No one is inclined to recreate your data for testing purposes when you have it to hand. So upload the workbook, manually add your calculated results, or at lease a sample of them, tell us which sheets/cells are the results as opposed to original data and how you have arrived at the result unless it's blindingly obvious.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
The sheet is empty, so with this sheet, you get as much help as before.![]()
Notice my main language is not English.
I appreciate it, if you reply on my solution.
If you are satisfied with the solution, please mark the question solved.
You can add reputation by clicking on the star * add reputation.
Hi,
If your data is always at minute intervals and always in column B then
Formula:
=AVERAGE(OFFSET(B1,MATCH(0,B:B,-1)-5,0,5,1))
Why don't you try it !
If i open your file i get an empty sheet with a few cells collored yellow.
Your respond is not what I meant.![]()
Why don't you try it !
I meant: Why don't you open your file, that you posted (and see what is in it).
Then you will see that it is empty.
How do you expect to get good help (from us), if you don't add an decent excel file to work with.![]()
I do have PowerPivot installed and I can't see any data. The data is there I suppose however it is not accessible.
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
This measure should work for your pivot table:
=if(countrows(values(PensacolaCH1[TIMESTAMP])) = 1,
CALCULATE(
AVERAGEX(VALUES(PensacolaCH1[TIMESTAMP]), PensacolaCH1[Sum of CHW_LT])
,PensacolaCH1[TIMESTAMP] <= VALUES(PensacolaCH1[TIMESTAMP]) && PensacolaCH1[TIMESTAMP] > VALUES(PensacolaCH1[TIMESTAMP])-TIME(0,5,0)
)
, blank())
Hey Izandol,
I am searching for the same issue. Unfortunately the formular results in blank cells.
Attachment 286283
dax.PNG
I do not get how to change this formula to receive a value
Format:
symbol nr timestamp open high low close volume
GDAXI 1 18.10.2011 09:01 5789,29 5789,29 5789,29 5789,29 0
GDAXI 2 18.10.2011 09:02 5788,8101 5789,5801 5783,54 5787,6299 0
...
But time intervall is not constant so only the last 3 rows should be used for an average
This formula is for measure not for calculated column.
- Please remember to mark threads Solved with Thread Tools link at top of page.
- Please use code tags when posting code: [code]Place your code here[/code]
- Please read Forum Rules
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks