Forum Discussion

FabvE's avatar
FabvE
Helper I
1 year ago
Solved

Running rowcount with filter by date

Hi, I tried various hints from this forum but found no solution for my problem. My data is like this: table name: Activity column Operation: different values like "FileUploaded", "FileDownloaded...
  • shafiz_p's avatar
    shafiz_p
    1 year ago

    Try this one :

     

     

    RunningTotalFileUploaded = 
    VAR CurrentDate = MAX(Activity[Date Created])
    VAR FilteredTable = 
        FILTER(
            ALL(Activity[Date Created]),
            Activity[Date Created] <= CurrentDate
        )
    RETURN
    CALCULATE(
        COUNTROWS(Activity),
        FilteredTable,
        Activity[Operation] = "FileUploaded"
    )

     

     

     

     

    If above measure still not workable, then try the summarize version given below. First will summarize the activity table by date created and operation and count and then do cummulative sum:

     

    RunningTotalFileUploaded = 
    VAR CurrentDate = MAX(Activity[Date Created])
    
    VAR SummaryTable = 
    SUMMARIZE(
        FILTER(
            ALL(Activity),
            Activity[Operation] = "FileUploaded"
        ),
        Activity[Date Created],
        Activity[Operation],
        "Count", COUNTROWS(Activity)
    )
    
    RETURN
    SUMX(
        FILTER(
            SummaryTable,
            [Date Created] <= CurrentDate
        ),
        [Count]
    )

     

     

     

     

    Hope this helps!!

    If this solved your problem, please accept it as a solution and a kudos!!

     

    Best Regards,
    Shahariar Hafiz