Forum

Problem in Runing T...
 
Notifications
Clear all

Problem in Runing Total using Pivot Table

4 Posts
2 Users
0 Reactions
88 Views
(@technotux)
Posts: 2
New Member
Topic starter
 

hi,

I want to add a RunningTotal column to my data using Pivot table
i've the following data:

id

Customer

item

SalesAmount

1 Global inc apple 50
2 Americana banana 10
3 Americana apple 100
4 Americana apple 60
5 Global inc apple 10

So i insert my data in a pivot table like the following:

 

It's a very simple pivot table with the "id" field in the rows section, and the "item" in the filters section, and the "SalesAmount" in the values section,

i set the "Show Value As" of the SalesAmount column "Value Filed settings" to "Runing Total in" and set the Base Field to id and it works fine,

but i also want to show the customer, so i add this field to the Rows section after the "id" Field but as soon as i do this the running total column becomes distorted, as if the summing process reset when the customer change, or Excel auto group the data according to the customer despite that i set the Base Field of the running total column to id.

What i really which is that excel calculate the running total across all the rows that are visible in the pivot table.

 
Posted : 19/03/2023 6:34 pm
(@mynda)
Posts: 4761
Member Admin
 

You can use this DAX measure:

=CALCULATE(SUM([SalesAmount]),Table1[id] <= MAX(Table1[id]), ALL(Table1[Customer]))

If you'd like to learn more about writing this kind of DAX measure, please consider my Power Pivot and DAX course.

Mynda

 
Posted : 20/03/2023 8:20 pm
(@technotux)
Posts: 2
New Member
Topic starter
 

Thanks for your answer,

unfortunately when i try to apply your solution i get error:

Calculation error in measure 'Table1'[measure1]: A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

i uses Office professional plus 2019, excel version 1908

 
Posted : 29/03/2023 6:27 pm
(@mynda)
Posts: 4761
Member Admin
 

Not sure what you did wrong, but it works for me. See attached.

Mynda

 
Posted : 29/03/2023 7:49 pm
Share: