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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.