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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KasperWF
Frequent Visitor

Running total for rows with start and end date columns

Hi Power BI Community!

I'm new to Power BI, but have created a few reports already. I have been looking around at various methods for creating running totals for sales, hours spend, etc. The problem is that most of them seem to focus on single values, whereas I am looking for something that takes a "subscription" with a start and end date into account. 

This is an example of how the data is structured (some columns left out). When a subscription is active, it has a start date, and the end date is NULL, when the subscription is cancelled, a subscription end date is set.

IDStartDateEndDate
12018-05-04 12:55:49.00000002018-06-07 09:53:39.0000000
22018-07-09 10:07:14.0000000NULL


So basically, I am trying to build a running total where on the date 2018-05-04 it will increment by 1, and on 2018-06-07 it will decrement by 1. 

I hope someone can help me out as I am unsure how to do this.

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @KasperWF ,

 

the challenge you are facing has a name, it's called event-in-progress.

 

This blog by Gerhard Brueckl is a great read, and also links to all the other important articles dedicated to this challenge.

I recommend to start with the article by Jason Thomas.

 

Hopefully, this provides the ideas you need to tackle the challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
KasperWF
Frequent Visitor

Thanks to everyone in the thread. I will try the suggestions and mark the question as answered when I have tried to run the measures.

V-lianl-msft
Community Support
Community Support

Hi @KasperWF ,

 

First create an unrelated calendar table.

Then create a measure like this:

measure =
CALCULATE (
    COUNTX (
        FILTER (
            'Table',
            'Table'[StartDate] <= MAX ( 'Table 2'[Date] )
                && (
                    ISBLANK ( 'Table'[EndDate] )
                        || 'Table'[EndDate] > MAX ( 'Table 2'[Date] )
                )
        ),
         ( 'Table'[ID] )
    )
)

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@KasperWF , refer if my blog can help on start & end date usages

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
TomMartens
Super User
Super User

Hey @KasperWF ,

 

the challenge you are facing has a name, it's called event-in-progress.

 

This blog by Gerhard Brueckl is a great read, and also links to all the other important articles dedicated to this challenge.

I recommend to start with the article by Jason Thomas.

 

Hopefully, this provides the ideas you need to tackle the challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors