Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago

Counting Between Dates

Good day, I'm new to power bi and I'm having problems with a formula that at first glance seems simple. I have already seen other similar posts in this forum, but I have not found a response.

I have a table with 3 columns: services rendered, start date and end date.

I need the formula to show the number of active services per year.

My formula is as follows:

Historical Assets = CALCULATE([Services],FILTER('Services','Services'[Start Date]&&'Services'[EndDate]))

I tested it using counts, countrows, using MIN and MAX and many more variants. But what counts are the services that started in that year, it does not take into account if the service started years before but is still in force.

For example, Service1 is in force from 2016 to 2024, but it only counts it in 2016, and so on.

I will thank you for your help.

3 Replies