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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
webportal
Impactful Individual
Impactful Individual

How to calculate a simple running total?

This is table: Customer

 

webportal_0-1605552993576.png

And this is table Transactions:

webportal_1-1605553017176.png

 

They are related by No.

 

I want the running total of Esaldo:

 

So:

 

Running total =
CALCULATE(
SUM(Transactions[ESaldo]),
FILTER(
ALL(
Transactions),
Transactions[Date] <= MAX(Transactions[Date])
)
)
 
This is wrong:
 
 
 

Captura de ecrã 2020-11-16 185953.jpg

 

Due to the external filter (slicer).

 

So, this should do it:

 

 
Running total 2 =
CALCULATE(
SUM(Transactions[ESaldo]),
FILTER(
ALLEXCEPT(Transactions, Transactions[no]),
Transactions[Date] <= MAX(Transactions[Date])
)
)
 
If the ALLEXCEPT was meant to be understood... It should remove all the filters from Transactions, and preserve the filter in column No.
 
But it wasn't and thus the result is the same:
 
 

So, maybe... ALLSELECTED?

 

Running total 3 =
CALCULATE(
SUM(Transactions[ESaldo]),
ALLSELECTED(Transactions[no])
)

 
Nope:
 
 

Captura de ecrã 2020-11-16 190714.jpg

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

@webportal ,

 

Have you checked the file? 



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

Proud to be a Super User!



View solution in original post

19 REPLIES 19
webportal
Impactful Individual
Impactful Individual

@camargos88 

 

I did, and it worked!

 

In only 3 hours of work I have a running total!

 

😀

camargos88
Community Champion
Community Champion

@webportal ,

 

Have you checked the file? 



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

Proud to be a Super User!



webportal
Impactful Individual
Impactful Individual

@camargos88 

 

webportal_0-1605563444653.png

 

camargos88
Community Champion
Community Champion

@webportal ,

 

Check the attached file, you need to keep the filter on name and ignore the other columns.



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

Proud to be a Super User!



webportal
Impactful Individual
Impactful Individual

And how about...

 

 
CALCULATE(
SUM(Transactions[ESaldo]),
FILTER(
ALL(Transactions),
Transactions[Date] <= MAX(Transactions[Date]) && Transactions[no] = SELECTEDVALUE(Customer[no])
)
)
camargos88
Community Champion
Community Champion

@webportal ,

 

Capture.PNGCapture1.PNG



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

Proud to be a Super User!



camargos88
Community Champion
Community Champion

@webportal ,

 

As I can see it's correct.

the last line is the same as the result. no ?

 



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

Proud to be a Super User!



@camargos88 

It is still wrong, because if you change the slicer to DEF, you get:

webportal_0-1605563107859.png

 

webportal
Impactful Individual
Impactful Individual

@camargos88 

 

It is still wrong:

 

webportal_0-1605562757682.png

 

camargos88
Community Champion
Community Champion

@webportal ,

 

Try this measure:

_RT = CALCULATE(SUM(Transactions[ESaldo]), FILTER(ALLEXCEPT('Transactions', Customer[Name]), 'Transactions'[Date] <= MAX('Transactions'[Date])))

 



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

Proud to be a Super User!



webportal
Impactful Individual
Impactful Individual

As you may see, it is still wrong...

 

webportal_0-1605557530054.png

 

webportal
Impactful Individual
Impactful Individual

Change the slicer to "DEF"...

camargos88
Community Champion
Community Champion

@webportal ,

 

You need to create a table date, and refer it inside the measure for running total.

 

Capture.PNG

 

 



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

Proud to be a Super User!



webportal
Impactful Individual
Impactful Individual
Fowmy
Super User
Super User

@webportal 

Your below measure should work, what id you get when you applied it?

 
Running total 2 =
CALCULATE(
SUM(Transactions[ESaldo]),
FILTER(
ALLEXCEPT(Transactions, Transactions[no]),
Transactions[Date] <= MAX(Transactions[Date])
)
)
 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

camargos88
Community Champion
Community Champion

@webportal ,

 

Your first used ALL(Transactions), this one is with ALL(Transactions[Date]).

 

Is still wrong using the date inside all ?

 


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

Proud to be a Super User!



camargos88
Community Champion
Community Champion

@webportal ,

 

Try this one:

CALCULATE(
SUM(Transactions[ESaldo]),
FILTER(
ALL(Transactions[Date]),
Transactions[Date] <= MAX(Transactions[Date])
)
)


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

Proud to be a Super User!



@camargos88 

 

I sure tried that one too...

 

webportal_0-1605555807532.png

 

@camargos88 

 

Thanks a lot, that was exactly my first atempt, as you can read in my post, but it is wrong.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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