+ Reply to Thread
Results 1 to 10 of 10

PowerPivot - how to calculate next month's value?

  1. #1
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    PowerPivot - how to calculate next month's value?

    Hi

    I have a simple table example below

    I am trying to get next months value i.e. for product X in 01/10/2014 I would like to get 20 which is value from 01/11/2014

    Can anyone help please?

    I tried Calculate(Sum(Product No),NextMonth(Date)) and few other Dax formulas like ClosingBalance etc and nothing works. I am sure I am making some silly mistake here but cannot figure this out.


    Product No| Date|Qty
    X|01/10/2014|10
    Y|01/10/2014|15
    Z|01/10/2014|11
    X|01/11/2014|20

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: PowerPivot - how to calculate next month's value?

    For a calculated column you could use:

    =sumx(filter(Table1,Table1[Product No]=earlier([Product No])&&DATEADD(Table1[Date],-1,month)=earlier([date])),Table1[Qty])
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: PowerPivot - how to calculate next month's value?

    Many thanks for your help. I typed exactly as per your post and got an error saying: The second argument of function EARLIER must be an integer greater than zero.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: PowerPivot - how to calculate next month's value?

    Which version of Excel and PowerPivot? That formula was taken directly from PowerPivot using the sample data you provided, so can you post a sample workbook in which you can't add it?

  5. #5
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: PowerPivot - how to calculate next month's value?

    Hello!

    I am using Excel 2013 unfortunately I cannot find infro about version. I believe it is standard that comes with Excel 2013.

    I attached an example of spreadsheet last column in red illustrates calculation that I need.


    Many thanks for all the help, I really appreciate it.


    EDIT:

    I got your formula working. It was my fault, typed it incorretly. Unfortunately it does not work the way I would like it and I think I identified the error but have no clue how to fix it

    The formula works well in scenario where product ABC is in both months but I may have a scenario where I had no product ABC in April but it appeared in May. In this case I still would like to see May figure as a closing figure for month April as per my attachement
    Attached Files Attached Files
    Last edited by illusionek; 01-23-2015 at 08:40 AM.

  6. #6
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: PowerPivot - how to calculate next month's value?

    Any ideas please ?

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: PowerPivot - how to calculate next month's value?

    For your example, do you expect to see rows for both April and May for ABC, or just April?

  8. #8
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: PowerPivot - how to calculate next month's value?

    I would hope to see both as per my attachment. The column in red is what I am trying to achieve.

    Many thanks!

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: PowerPivot - how to calculate next month's value?

    I'm not sure if that's possible in Power Pivot as you would effectively be creating rows of data that don't exist.

  10. #10
    Registered User
    Join Date
    08-11-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: PowerPivot - how to calculate next month's value?

    Many thanks for all your help. Unfortunately I arrived at the same conclusion. The only way I can see it working is if I do cartesian join between months and product numbers in Access for example and only then use your formula.

+ 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: 06-02-2014, 09:34 AM
  2. Replies: 0
    Last Post: 01-21-2014, 07:48 AM
  3. [SOLVED] Lookup month and calculate if specific month value apply
    By D-smoke in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-24-2013, 03:03 AM
  4. [SOLVED] calculate pay checks per month, to get monthly income value for that month.
    By tladd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-20-2012, 09:51 PM
  5. Replies: 0
    Last Post: 11-20-2012, 05:34 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