Forum Discussion
sandeepk66
Advocate I
8 years agoNeed Cumulative Sum by Item
Hi Geeks, Need Cumulative Sum of the AMOUNTper each Item. I have created a column ' Cumulative Sum' in Excel, which is basically AMOUNT+Qty-Liability per Item. needed to replicate same in PowerBI...
- 8 years ago
Hi Again sandeepk66
In anycase, here is a calculated column that might work
Column = VAR StartRowAmount = MINX(FILTER(Examples,'Examples'[ITEM] = EARLIER('Examples'[ITEM])),'Examples'[AMOUNT]) RETURN CALCULATE( StartRowAmount + SUM([SALE Amount]) - SUM([Liability]) , FILTER( ALL('Examples'), 'Examples'[RowID] <= EARLIER('Examples'[RowID]) && 'Examples'[ITEM] = EARLIER('Examples'[ITEM])) )
Phil_Seamark
Microsoft Employee
8 years agoHi sandeepk66
Just checking. In the first line of each of your product groupings, you use three column to determine the result, then from that result, the next lines only use 2 columns. Is that what you meant to do, or was that a typo?
Phil_Seamark
Microsoft Employee
8 years agoHi Again sandeepk66
In anycase, here is a calculated column that might work
Column =
VAR StartRowAmount = MINX(FILTER(Examples,'Examples'[ITEM] = EARLIER('Examples'[ITEM])),'Examples'[AMOUNT])
RETURN
CALCULATE(
StartRowAmount +
SUM([SALE Amount]) -
SUM([Liability])
, FILTER(
ALL('Examples'),
'Examples'[RowID] <= EARLIER('Examples'[RowID])
&& 'Examples'[ITEM] = EARLIER('Examples'[ITEM]))
)