Sure happy to look into this but need to know more.
There’s a lot at play here so need to understand the data within the tables, how you setup your data model including the relationships you have and also what is the current context of the calculation.
Unfortunately with DAX it’s never a simple as just reviewing the formula by itself, there always more to it.
If you want to add a demo model here with the scenario then that will speed up assistance.
Chrs
Just as a side note on this as well as what you’re looking for is very very similar to a technique called ‘Events in Progress’
Check out this tutorial at Enterprise DNA Online for how it works. I think you might go aha when you watch this and how it is set up as it’s quite unique
Also another real-world example of it can be found here using a slight different formula, but calculates exactly the same then I believe you are after.
Starting around the 19min mark
See how you go with these and let me know how you go.