how to use SUMX

sadath

Active Member
Joined
Oct 10, 2004
Messages
262
Office Version
  1. 365
Platform
  1. Windows
I have following formula to calculate total sales

TotSales'16:=if([StewTot]>=10,sum(SALESDATA[AMOUNT]),blank())

[StewTot] as the formula = Sum('STEWARD ATTENDANCE'[DAYS WORKED])

it works in PT with month on row filter, but total is getting wrong.

so, to show the correct total i tried this

SubTotal:=sumx(VALUES('STEWARD ATTENDANCE'[DAYS WORKED]),
CALCULATE (
sum(SALESDATA[AMOUNT]),
'STEWARD ATTENDANCE'[DAYS WORKED] >= 10))
returns wrong value...
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
If the pivot table rows retun the correct value but the total doesn't, you need to simulate the rows in your formula. So you need to iterate over sumx(values(table[column in row in your pivot]),[the measure that works on rows but not in totals])

read my article here
http://exceleratorbi.com.au/sum-vs-sumx-in-dax/
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,678
Members
449,116
Latest member
HypnoFant

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