+ Reply to Thread
Results 1 to 4 of 4

PowerPivot SUMIF type Calculated Column ERROR

  1. #1
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    PowerPivot SUMIF type Calculated Column ERROR

    Hello All,

    I thought this was pretty straight forward in PowerPivot, but I am missing something.

    I have a basic table (I thought) where I have several columns of product attributes, 1 column with YEAR, and a Key Figure (quantity). It is set up very simply for pivot tables.

    I want to be able to have a calculated column that SUM's the Key Figure (quantity) for each of the product attributes and year combinations.

    Here is how the data structure looks:

    [CUSTOMER] | [ATTRIBUTE 1] | [ATTRIBUTE 2] | [ATTRIBUTE 3] | [ATTRIBUTE 4] | [YEAR] | [QUANTITY] | [Calculated Column - Total Quantity filtered to attributes in row]

    For each combination of attributes and unique year (not customer) I want to see the sum of the quantities.

    You can see the attached dummy data (not in PowerPivot) for what I mean. My real data set is much bigger as you would imagine.

    I tried =CALCULATE(SUM([QUANTITY]),[ATTRIBUTE 1],[ATTRIBUTE 2],[ATTRIBUTE 3],[ATTRIBUTE 4],[YEAR]) in a Calculated Column.
    but I keep getting errors. =SUM([QUANTITY]) works just fine on it's own. But I need to find the sum of all the quantity for the relevant attributes + year...

    This is just 1 step in my project and I am stuck now.

    Any thoughts? Am I just missing understanding the syntax for DAX?

    Thanks,
    Matt
    Attached Files Attached Files

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

    Re: PowerPivot SUMIF type Calculated Column ERROR

    Why do you want a calculated column rather than a simple SUM([QUANTITY]) measure that is automatically filtered by its context in a pivot table?
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    Re: PowerPivot SUMIF type Calculated Column ERROR

    Hello Rory,

    sorry for the delay, had to go on a long business trip at the last minute.

    I need this because it is just one of the many calculations in the powerpivot I need to make and my data set is pretty large. For example, I have to make a second that calculates the weight of the row Quantity...but I can only do that if I have the pre-filtered sum of that total quantity based on my above attributes+year.

    Thoughts?

    Thanks,
    Matt

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

    Re: PowerPivot SUMIF type Calculated Column ERROR

    I confess I'm still not sure why you are doing this in a calculated column - I think any pivot table you build from it will be strange - but a basic formula would be:

    =SUMX(filter(table1,Table1[ATTRIBUTE 1]=earlier(Table1[ATTRIBUTE 1])&&Table1[ATTRIBUTE 2]=EARLIER(Table1[ATTRIBUTE 2])&&Table1[ATTRIBUTE 3]=EARLIER(Table1[ATTRIBUTE 3])&&Table1[ATTRIBUTE 4]=EARLIER(Table1[ATTRIBUTE 4])&&Table1[YEAR]=EARLIER(Table1[YEAR])),Table1[QUANTITY])

+ 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. Find Function in Calculated Column in PowerPivot always returns ERROR
    By Jennifer90 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-03-2014, 05:35 AM
  2. Replies: 2
    Last Post: 06-02-2014, 09:34 AM
  3. New calculated Field in Powerpivot
    By ehardway111 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-22-2013, 03:07 PM
  4. Replies: 0
    Last Post: 11-20-2012, 05:34 AM
  5. Replies: 0
    Last Post: 06-22-2012, 07:13 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