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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,223,630
Messages
6,173,450
Members
452,514
Latest member
cjkelly15

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