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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
gwjjjjj
Frequent Visitor

Calculate running total based on sales

Hi, I would like to calculate the running total based on the product sales.

Below is my sample dataset:

gwjjjjj_0-1717111257503.png

I want to calculate the running total in this order: group by product, and get total sales for each product. And calculate running total sales based on that.

gwjjjjj_1-1717111316912.png

I tried to use running total measure in power bi, but it doesn't work.

Does anyone happend to know the solution for this question? Thanks ahead.

1 ACCEPTED SOLUTION

@gwjjjjj 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @gwjjjjj ,

 

You can try formula like below:

MEASURE =
VAR SUM_BY_Pro =
    CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Table', 'Table'[Product] ) )
RETURN
    DIVIDE ( SUM_BY_Pro, CALCULATE ( SUM ( 'Table'[Sales] ), ALL ( 'Table' ) ) )

vkongfanfmsft_0-1717118565936.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ryan_mayu
Super User
Super User

@gwjjjjj 

you can try this

 

Measure = sum('Table'[Sales])
PROPORTION = [Measure]/CALCULATE(SUM('Table'[Sales]),ALL('Table'))
P2 =
var _PROPORTION=[PROPORTION]
RETURN CALCULATE([PROPORTION],FILTER(ALL('Table'[Product]),[PROPORTION]>=_PROPORTION))
 
11.PNG
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




That's works! One more question if you don't mind. If I have one more column called month. I want to add a month slicer, so user can check running total for different month. I try to use your method to do it, but it doesn't work.  Thank you so much for your help.

gwjjjjj_0-1717134067865.png

 

@gwjjjjj 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors