0
votes

I have the simple dataset as below:

enter image description here

I need to permit summing the DistanceTraveled column in a "Measure" given date filters selected, and date order, to allow a cumulative total. The data model is dead simple as it only have one date dimension:

enter image description here

My DAX for the measure is:

Measure = CALCULATE(SUM(ActivityReport[DistanceTraveled]), FILTER(Timestamp,Timestamp[Timestamp] <= MAX(Timestamp[Timestamp])))

I know I must be missing something simple, how can I create a cumulative total given the filtered and increasing Timestamps for column DistanceTraveled?

2

2 Answers

0
votes

I think you forgot to include all dates, Try this..

Measure = CALCULATE(
                   SUM(ActivityReport[DistanceTraveled]), 
                  FILTER(ALL('Timestamp'[Timestamp]),
                  Timestamp[Timestamp] <= MAX(Timestamp[Timestamp])
                        )
                   )
0
votes

What I ended up doing:

Measure = CALCULATE(
                   SUM(ActivityReport[DistanceTraveled]), 
                  FILTER(ALLSELECTED(ActivityReport),
                  ActivityReport[Timestamp] <= MAX(ActivityReport[Timestamp])
                        )
                   )