Formula for calculating miles completed in month to current entry date

Would be grateful if someone can debug this expression as it is giving nil return,

sum(
SELECT(
(Miles[Miles Completed]),
AND(
[DATE] <= [_THISROW].[DATE],
MONTH([Date])=MONTH [_THISROW].[DATE]
)
)
)

I am trying to show the cumulative miles completed in each month up to and including the day entry for each record.

I get the result for current month by substituting

MONTH([Date])=MONTH [_THISROW].[DATE]

with

MONTH([Date])=MONTH(TODAY())

but this naturally only gives the correct result for the current month.

Many Thanks.

Maybe you wish to try instead

MONTH([Date])=MONTH ([_THISROW].[DATE])

1 Like

Perfect. Many thanks for your quick response.

2 Likes