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

View all the Fabric Data Days sessions on demand. View schedule

Reply
goncalogeraldes
Super User
Super User

Percentage of Running Total for a Matrix

Hello there! I am trying to obtain the running total for the percentagem of the total value. I have tried many solutions that I found here in the community but they all turn out like in the image. That is, it is calculating "correctly" but not in the correct order. What I want in the first row is 21,89%, second row 42,69, third row 52,84 and so on... Currently it is calculating the percentages in alphabetical order but I need it by the total sum (please note that the "€" is sorted)

 

goncalogeraldes_0-1629906332784.png

 

Thanks in advance!! 

Gonçalo Costa

 

10 REPLIES 10
Anonymous
Not applicable

Hi @goncalogeraldes ,


Could you tell me if your problem has been solved?
If it is, kindly Accept the useful reply as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your problem.


Best Regards,
Stephen Tao

Unfortunately I still do not have a solution to this... I have tried many methods but none seems to work... Thanks for your suggestions though!

PaulDBrown
Community Champion
Community Champion

Create a measure for the total sales, using something along the lines of:

Total sales by customer= CALCULATE ([Sum sales], ALL(table[Customer name))

 

and finally use your current running total in 

% running total = DIVIDE( [your running total measure], [Total sales by customer])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown Thanks for your reply for unfortunately this wont work. The problem is the same as in the print I sent the response to nvprasad reply

There must be something going on with the filter context. Here is a quick example:

Cumul. sales by product ref =
VAR Rnk = [RANK Sales by Product Ref]
RETURN
    IF (
        ISINSCOPE ( 'DIM Product Ref'[Product REF] ),
        CALCULATE (
            [Sum of Sales],
            FILTER (
                ALL ( 'DIM Product Ref'[Product REF] ),
                [RANK Sales by Product Ref] <= Rnk
            )
        )
    )

 

 

 

Sales all prod ref = CALCULATE([Sum of Sales], ALL('DIM Product Ref'[Product REF]))
% cumulative = DIVIDE([Cumul. sales by product ref], [Sales all prod ref])

 

 

Captura.JPG

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






nvprasad
Solution Sage
Solution Sage

Hi goncalogeraldes,

I am hoping you are trying to calculate running % based on date.

Running%Total =
Var RunningTotal = CALCULATE([Sales Amount],FILTER(ALL('Date'),'Date'[Date]<=MIN('Date'[Date])))
Var TotalSales = CALCULATE([Sales Amount],ALL('Date'))
Var result = DIVIDE(RunningTotal,TotalSales,0)
Return result
 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

@nvprasad Thanks for the fast response! The problem here is that this based on the Customer Name and not the Date column so unfortunately this wont work... This one is actually quite similar to the one I have now!

Hi,

 

Could you please check with the below logic.

 

RunningTotal%Check =

Var rankcheck = RANKX ( ALL ( 'Product'[Product Name] ), [Sales Amount],, DESC )
Var runningTotal = CALCULATE([Sales Amount], FILTER(ALL('Product'[Product Name]),RANKX ( ALL ( 'Product'[Product Name] ), [Sales Amount],, DESC )<=rankcheck))
Var totalSales = CALCULATE([Sales Amount],ALL('Product'[Product Name]))
Return DIVIDE(runningTotal,totalSales,0)

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

 
Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Hi there @nvprasad ! Thanks for the help! Unfortunately this is the result with your formula...

 

goncalogeraldes_0-1629966182424.png

 

goncalogeraldes_1-1629966210369.png

 

Any ideas on what is hapenning? 

 

@nvprasad I swithched the order of the "rankcheck" and the "runningtotal" and it makes a little bit more sense but it gives the opposite result of what i need. I think its almost there! Here is the result:

 

goncalogeraldes_2-1629966503503.png

 

goncalogeraldes_3-1629966537429.png

I need it reversed!

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors