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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Trying to create a cumulative total for people onboard a bus between bus stops

Hi!
As the subjectline foretells i am trying to create a culumative total.

DanZloo_0-1671704499352.png


I am trying to create a measure or a calculated column that takes totalInBalance and totalOutBalance into consideration.
So the new measure/column to the far right of the table should be:
12 on row 1,
11 on row 2,
9 on row 3
and so on

Any help would be much obliged!

Kind Regards
/D

1 ACCEPTED SOLUTION
HiraNegi
Resolver II
Resolver II

Hi,

You can create measures/columns to calculate the running sum of InBalance and OutBalance and subtract to get the final result.

 

Here is the final screenshot with sample data.

HiraNegi_0-1672219930645.png

Below measures were created.

Note: you can incorporate all measures into one as well.

 

InBlanace(RTotal) = CALCULATE(sum('Table (2)'[InBalance]), 'Table (2)'[Position] <= MAX('Table (2)'[Position]))
 
OutBlanace(RTotal) = CALCULATE(sum('Table (2)'[OutBalance]), 'Table (2)'[Position] <= MAX('Table (2)'[Position]))
 
RTotal_Difference = [InBlanace(RTotal)] - [OutBlanace(RTotal)]
 
Hope this helps.
 

View solution in original post

4 REPLIES 4
HiraNegi
Resolver II
Resolver II

Hi,

You can create measures/columns to calculate the running sum of InBalance and OutBalance and subtract to get the final result.

 

Here is the final screenshot with sample data.

HiraNegi_0-1672219930645.png

Below measures were created.

Note: you can incorporate all measures into one as well.

 

InBlanace(RTotal) = CALCULATE(sum('Table (2)'[InBalance]), 'Table (2)'[Position] <= MAX('Table (2)'[Position]))
 
OutBlanace(RTotal) = CALCULATE(sum('Table (2)'[OutBalance]), 'Table (2)'[Position] <= MAX('Table (2)'[Position]))
 
RTotal_Difference = [InBlanace(RTotal)] - [OutBlanace(RTotal)]
 
Hope this helps.
 
Anonymous
Not applicable

Hi PBI Community!

 

Still need help with this. This is not resolved. 

 

Any help would be much obliged!

 

Mvh

Anonymous
Not applicable

Hi @Idrissshatila Thank you. I have tried but i think that i need som help with the syntax.

BR
/D

Idrissshatila
Super User
Super User

Hello,

 

This article will help you solve your problem.

https://www.daxpatterns.com/cumulative-total/

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.