Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gpensabene
Frequent Visitor

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,

1 ACCEPTED SOLUTION

Hi @Gpensabene 

 

Sorry should have a reference table and not duplicate, please see the attached.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @Gpensabene 

 

Please see the attached file with a solution

 
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Hi @Mariusz 

It is not work, you have add an hardcoded table with the current order.

 

I added new records at 'A'

2020-04-23_11-16-25.jpg

expected

CodeQtyExpected values
A88
B513
C114
D115
E116

 

Thanks for the attempt

Hi @Gpensabene 

 

Sorry should have a reference table and not duplicate, please see the attached.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi,

     these pbix files have a fault on opening.

dmcn_pbix

Hi @Mariusz 

thanks for the solution.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors