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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. 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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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