Power Pivot running total by categrory repeating for other groupings.

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hi,
I've had this problem before and am pretty certain use and "IF" statement to solve it but cannot get the right result,
Example formula ;

Excel Formula:
RTM Just  a :=
VAR calcA =
    CALCULATE (
        [totalSales],
        FILTER (
            CROSSJOIN ( ALL ( Table1[Date] ), ALL ( Table1[Item] ) ),
            Table1[Date] <= MAX ( Table1[Date] )
                && Table1[Item] = "a"
        )
    )
RETURN
   CalcA

1663689922722.png


This gives the correct result but repeats it for every grouping not just 'a' how can I stop this? There are Totals for every row so can't use ;
IF(TotalSales, Calc , Blank()) , but think I need to use something along these lines.

Richard.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi,
I've had this problem before and am pretty certain use and "IF" statement to solve it but cannot get the right result,
Example formula ;

Excel Formula:
RTM Just  a :=
VAR calcA =
    CALCULATE (
        [totalSales],
        FILTER (
            CROSSJOIN ( ALL ( Table1[Date] ), ALL ( Table1[Item] ) ),
            Table1[Date] <= MAX ( Table1[Date] )
                && Table1[Item] = "a"
        )
    )
RETURN
   CalcA

View attachment 74382

This gives the correct result but repeats it for every grouping not just 'a' how can I stop this? There are Totals for every row so can't use ;
IF(TotalSales, Calc , Blank()) , but think I need to use something along these lines.

Richard.
Use keepfilters in the total sales measure
Excel Formula:
Just 'a' Total Sales:=CALCULATE([Total Sales], KEEPFILTERS(FILTER(ALL(Table1[Item]),Table1[Item]= "a" ) ) )
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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