Forum Discussion

maf's avatar
maf
Regular Visitor
9 years ago

Running Count

I've titled this Running Count rather than Running Total as I've seen plenty of examples that sum numerics to a given date.

 

I'd like to count rows to a date rather than sum values.

 

A good example would be Installs.  A row with a timestamp is added to the Installs table everytime someone installs an app (suprisingly).  So...

 

Mon 6 installs

Tue  10 installs

Wed 20 installs

 

would give Installs to date as...

 

Mon 6

Tues 16

Wed 36

 

Any ideas ?

11 Replies

  • Hey,

     

    here is a little example

     

    On the page YTD Variations you will find this measure

    Cumulated Count Rows = 
    CALCULATE(
     COUNTROWS('FactWithDates'),
     FILTER(
      ALL('Calendar'),
      'Calendar'[Date] <= MAX('FactWithDates'[Date]) &&
      'Calendar'[Year] = MAX('Calendar'[Year])
     )

     Here just the visible rows in the current FilterContext (introduced using CALCULATE()) are counted

     

    Hope this helps

    • maf's avatar
      maf
      Regular Visitor

      Appologies for my ignorance but I don't see any running count on that page.

      • TomMartens's avatar
        TomMartens
        Super User

        Now it's there again, somehow I managed to not use the measure in the table viz