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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
BartVanH
Frequent Visitor

Running total for 'row count'

Hi,

 

I'm looking for a variant of the often mentioned running total calculation.

My data does not contain the numbers to add up in the running total, like most Sales data examples around.

My data IS the number to add up, each row being a ticket at a Service Desk.

I would like to know the running total for tickets created and/or closed, by Date:

 

Source data 
NrCreationClosure
INC00011/01/20191/05/2019
INC00021/01/20191/06/2019
INC00031/02/20191/06/2019
REQ00011/01/20191/07/2019
REQ00021/02/20191/07/2019
REQ00031/02/20191/08/2019

 

Filtering 'INC*' from 'REQ*' can be done on a visual level, so I don't think that needs to be in the code(?)

 

So I would like to end up with these results (not necessarily combined in 1 measure/visual/...):

Incidents opened  Incidents closed 
     
01/20192 05/20191
02/20193 06/20193
     
     
Requests opened  Requests closed 
     
01/20191 07/20192
02/20193 08/20193

 

Thanks for the help!

1 ACCEPTED SOLUTION

Hi @BartVanH

You could refer to modifying your formula as below:

Measure running total in value = 
SUMX(FILTER(ALLEXCEPT(Table1,Table1[Attribute],Table1[Legend],Table1[Nr]),'Table1'[Value]<=MAX('Table1'[Value])),[Measure])

Result:

1.PNG

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @BartVanH,

Based on my test, you could refer to below steps:

Unpivot your Creation and Closure column in query editor:

1.PNG

Result:

1.PNG

Apply it and create below measures:

Measure = CALCULATE(COUNT(Table1[Value]))
Measure running total in value = 
SUMX(FILTER(ALLSELECTED(Table1[Value]),'Table1'[Value]<=MAX('Table1'[Value])),[Measure])

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-danhe-msft,

 

Thanks a lot!

 

The calculation seems to work perfectly!

 

Here it is in a line graph:

Line graph - Date.jpg

 

However, when I select the Date Hierarchy in the field well:

Line graph - Field well.jpg

 

It all reverts back to the individual values once I start drilling down...

I have a feeling I know why it's doing that, but is there any way around?

 

 

Line graph - Date Hierarchy.jpg

 

The first version is not my favorite, it's not the most aesthetic way to display the data.

But if there is no way around, I'll use that.

 

Thanks again!

 

Bart

Hi @BartVanH

You could refer to modifying your formula as below:

Measure running total in value = 
SUMX(FILTER(ALLEXCEPT(Table1,Table1[Attribute],Table1[Legend],Table1[Nr]),'Table1'[Value]<=MAX('Table1'[Value])),[Measure])

Result:

1.PNG

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Beautiful, thanks!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors