Forum Discussion

Gpensabene's avatar
Gpensabene
Frequent Visitor
6 years ago
Solved

Cumulative Total on Result Table

Hi,

I am trying to include a column for cumulative sum in Power BI table visual.

Obviously the following version is a simplified scenario compared to the complex case I am implementing.

 

Sample table

CodeQty
A1
A1
B1
C1
A1
D1
E1
B1
B1
B1
B1

 

Result table without Cumulative total (order by Qty descending)

CodeQty
B5
A3
C1
D1
E1

 

DAX formula the I use at the moment

Running Total MEASURE = CALCULATE (
SUM ( Tabella[Qty] );
FILTER (
ALLSELECTED( Tabella );
Tabella[Qty] <= MAX ( Tabella[Qty] )
)
)
 
The "Running Total MEASURE" shows a Sum of all rows because the Qty is the same, I have add the column with the Expected values
CodeQtyRunning Total MEASUREExpected values
B5115
A3118
C1119
D11110
E11111

 

Any help would be greatly appreciated.

 

Regards,

5 Replies