Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Running Total Measure with Filter

Hey guys,

I've got the following Measure:

Visits My Page = CALCULATE(
DISTINCTCOUNT('All Page Visits'[VISIT_ID]),
FILTER('All Page Visits','All Page Visits'[PAGE_URL]="https://my.page.nl/login")

Resulting in the following table:

 

But I'm trying to make a measure for the running total. I'm struggling due to the fact that I have a filter.
Is it possible to use the measure above in another measure?

With kind regards,

Önder



  • yes, you could do something like

    Running Total =
    var maxDate = MAX('Date'[Date])
    return CALCULATE( [Visits My Page], REMOVEFILTERS( 'Date'), 'Date'[Date] <= maxDate)

2 Replies

  • yes, you could do something like

    Running Total =
    var maxDate = MAX('Date'[Date])
    return CALCULATE( [Visits My Page], REMOVEFILTERS( 'Date'), 'Date'[Date] <= maxDate)
  • Anonymous's avatar
    Anonymous
    Not applicable

    Wow Johnt75,

    This helped me a lot. I really need to learn how to work with variables I guess...
    Thanks a lot.