Results 1 to 5 of 5

Power Pivot DAX average calculation of a time period

Threaded View

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

    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;


    =IF( ROW(1:1)<7, 
    
                      SUMIFS([Sales],[Date],"<="&[@Date],[Date],">"&[@Date]-7)/ROW(1:1)
    
                                                                                    ,SUMIFS([Sales],[Date],"<="&[@Date],[Date],">"&[@Date]-7)/7)

    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

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