+ Reply to Thread
Results 1 to 15 of 15

Help on calculating moving average using DAX

  1. #1
    Registered User
    Join Date
    08-09-2013
    Location
    austin
    MS-Off Ver
    Excel 2013
    Posts
    6

    Help on calculating moving average using DAX

    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

  2. #2
    Registered User
    Join Date
    08-09-2013
    Location
    austin
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Help on calculating moving average using DAX

    Anybody can help on this?

    Quote Originally Posted by kaka20461977 View Post
    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. Attachment 270224

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help on calculating moving average using DAX

    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 icon below the post.

  4. #4
    Registered User
    Join Date
    08-09-2013
    Location
    austin
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Help on calculating moving average using DAX

    Thanks for your kind reminder! I attached the data file. Hopefully, I can get the answer soon.

    Quote Originally Posted by Richard Buttrey View Post
    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.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help on calculating moving average using DAX

    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.

  6. #6
    Registered User
    Join Date
    08-09-2013
    Location
    austin
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Help on calculating moving average using DAX

    It's not empty. See the file size (278.5kb). Please go click 'POWERPIVOT', then click 'Manage', then you will see the data. As I mentioned earlier, I'm pretty new to powerpivot, I appreciate everybody's time and help!!

    Quote Originally Posted by oeldere View Post
    The sheet is empty, so with this sheet, you get as much help as before.

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help on calculating moving average using DAX

    Why don't you try it !

    If i open your file i get an empty sheet with a few cells collored yellow.

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Help on calculating moving average using DAX

    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

  9. #9
    Registered User
    Join Date
    08-09-2013
    Location
    austin
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Help on calculating moving average using DAX

    I don't know why you cannot access the data. I attached another file and copied and pasted the data.

    Quote Originally Posted by AlKey View Post
    I do have PowerPivot installed and I can't see any data. The data is there I suppose however it is not accessible.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-09-2013
    Location
    austin
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Help on calculating moving average using DAX

    Thanks for your reply!!! If I know how to do it, why did I ask for help here?

    Quote Originally Posted by oeldere View Post
    Why don't you try it !

    If i open your file i get an empty sheet with a few cells collored yellow.

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help on calculating moving average using DAX

    Please Login or Register  to view this content.
    Your respond is not what I meant.

    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.

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help on calculating moving average using DAX

    Hi,

    If your data is always at minute intervals and always in column B then

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  13. #13
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Help on calculating moving average using DAX

    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())

  14. #14
    Registered User
    Join Date
    12-27-2013
    Location
    Frankfurt, Germany
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Help on calculating moving average using DAX

    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

  15. #15
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Help on calculating moving average using DAX

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help Calculating A Simple Moving Average
    By artiststevens in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-13-2013, 11:40 PM
  2. Calculating a Moving Average
    By agentred in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2010, 01:30 PM
  3. calculating average with moving startpoint
    By broer konijn in forum Excel General
    Replies: 4
    Last Post: 06-23-2006, 03:20 AM
  4. calculating moving average
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-14-2006, 06:20 AM
  5. [SOLVED] calculating moving average
    By odey1234 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-29-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1