+ Reply to Thread
Results 1 to 5 of 5

Power Pivot DAX average calculation of a time period

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Power Pivot DAX average calculation of a time period

    Hi,
    i'd like to calculate the average of a cumulative figures by a given time interval, so example 7 days, so the total for a rolling 7 day period would be divided by 7, not the number of figures in that interval;

    So if between 11th and the 17th there were 2 returns that that would be the total divided by 7 not 2.

    Just dividing by 7 is fine once you have more than seven dates, in excel I'd use ROW() inside an if statement as the divosor;


    Please Login or Register  to view this content.

    I've been trying to come up with something similar in DAX, but can't find a function similar to ROW() ,

    is there a way around this I was going to try datesbetween but if anyone has any suggestions ( helpfull 😀 )

    workbook attached.

    Richard
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Power Pivot DAX average calculation of a time period

    maybe

    https://learn.microsoft.com/en-us/dax/row-function-dax

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Power Pivot DAX average calculation of a time period

    If you use your calendar date column in the pivot, then you could use a measure like:

    Please Login or Register  to view this content.
    Rory

  4. #4
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Power Pivot DAX average calculation of a time period

    I've used this but will go through your suggestion,


    Please Login or Register  to view this content.

    Then to get 1,2,3,4,5,6 and then 7 onwards,

    Please Login or Register  to view this content.
    and lastly

    Please Login or Register  to view this content.

    Seem to work, I'll let you know how I get on with your suggestion,

    Richard.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    608

    Re: Power Pivot DAX average calculation of a time period

    BTW, I did realize after posting I'd overcomplicated, and I could use the count for everything, I just had the excel structure on the brain.

    Richard.

+ 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. Replies: 2
    Last Post: 12-17-2021, 08:41 AM
  2. [SOLVED] Average value for a given time period applied to all previous time periods
    By fpkid1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-27-2021, 11:52 AM
  3. Hourly calculation over a period of time
    By soodaakash04 in forum Excel General
    Replies: 10
    Last Post: 04-03-2020, 03:42 PM
  4. Replies: 2
    Last Post: 02-03-2017, 07:39 AM
  5. Replies: 11
    Last Post: 05-20-2011, 02:09 PM
  6. Specific time period calculation from a time range
    By Khaldon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2011, 06:44 AM
  7. [SOLVED] Time calculation for a givenn period
    By KT in forum Excel General
    Replies: 1
    Last Post: 04-27-2005, 01:06 PM

Tags for this Thread

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