+ Reply to Thread
Results 1 to 4 of 4

Power Pivot DAX cumulative Average by grouping

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

    Power Pivot DAX cumulative Average by grouping

    Hi,
    I'm trying to create a cumulative average by a group so

    Date 1
    Date 2
    Date 3 etc and average the cumulative average for each date, so here dvide by 1 then 2 and 3 , not the total number of rows, if date 1 occurs more than once, I've attached a worksheet with an excel table showing what I'd like to do plus pivot with a couple of failed attempts, which I think explains better than this, any help with rolling avarages welcome.

    I think I need to use allselected or something.

    Richard
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,525

    Re: Power Pivot DAX cumulative Average by grouping

    Perhaps this will help.
    1. Add a column to the source data (No. Dates) populated using: =SUM(MAX(H$6:H6),IF(COUNTIFS(E$7:E7,E7)=1,1,0))
    2. Add a measure (Max of Dates) using: =MAX(Table1[No. Dates])
    3. Add another measure (Average) using: =[Running total M]/[Max of Dates]
    4. In the pivot table at the bottom of the Pivot sheet, drag the Average measure into the Values area
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

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

    Re: Power Pivot DAX cumulative Average by grouping

    Hi,
    I'll have a look at what you suggested, I haven't tried it but can see what it's doing, but I managed to sort it out yesterday, and it was pretty obvious when I'd done it,


    Please Login or Register  to view this content.
    Will divide by the number of dates, but my error was uisng the running total measure rather than just total, so

    Please Login or Register  to view this content.
    and this does give the average for each distinct date, not all the dates used in the total calculation, I think it's all to do with Calculate and aggregation. I'll mark this up as solved and thanks or the suggestions.

    RD

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,525

    Re: Power Pivot DAX cumulative Average by grouping

    Glad that you got a solution. Thank You for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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] Power Pivot/Query: Cumulative inventory based on future sales
    By 63falcondude in forum Excel General
    Replies: 5
    Last Post: 06-20-2022, 09:08 AM
  2. Replies: 2
    Last Post: 12-17-2021, 08:41 AM
  3. Grouping Date in Power Pivot
    By piku9290dgp in forum Excel General
    Replies: 1
    Last Post: 06-10-2021, 01:53 AM
  4. Replies: 8
    Last Post: 08-17-2020, 06:05 PM
  5. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  6. [SOLVED] Grouping Dates in Power Pivot
    By kersplash in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-15-2018, 09:57 PM
  7. [SOLVED] Average of Count in Pivot Table with Grouping
    By Ian in forum Excel General
    Replies: 2
    Last Post: 04-02-2005, 11: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