Grand Total not summing PowerPivot measure column

lmtaylor

New Member
Joined
Mar 21, 2013
Messages
3
I need a grand total that sums the column. I have an if statement in my measure and the Grand Total is showing up as blank rather than summing the column. I know that sumx will usually work but I'm not sure where to put it here.
Here is the formula: =if(countrows(values(Sub))=1,if(values(Sub)=01,COGS[3 Month Avg COGS]*3,COGS[3 Month Avg COGS]*2))
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try this:

=SUMX(VALUES(Sub), IF(VALUES(Sub)=1,COGS[3 Month Avg COGS]*3,COGS[3 Month Avg COGS]*2))
 
Upvote 0
This gives an error message- "Calculation error in measure 'COGS'Target Inv Level]: A table of mulitple values was supplied where a single value was expeceted.
I need the if statement to be 01 because the Sub is text and defined as 01 not 1.
 
Upvote 0
Sorry. I don't think you need the VALUES() inside the IF() with a SUMX.


If removing 2nd VALUES() in mine doesn't work, then try replacing the 2nd argument of the SUMX with your original measure.
 
Upvote 0
Sorry, maybe I wasn't clear when I said remove the second VALUES(). I meant leave the column reference but just get ride of the VALUES() around it:

=SUMX(VALUES(Sub), IF(Sub=1,COGS[3 Month Avg COGS]*3,COGS[3 Month Avg COGS]*2))

This should work without errors, but as long as you have a workaround that works then you are good to go.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,720
Members
448,986
Latest member
andreguerra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top