Forum Discussion
FabvE
1 year agoHelper I
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...
- 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
shafiz_p
1 year agoSuper User
Hi FabvE Try this:
RunningTotalFileUploaded =
CALCULATE(
COUNTROWS(Activity),
FILTER(
ALL(Activity),
Activity[Date Created] <= MAX(Activity[Date Created]) &&
Activity[Operation] = "FileUploaded"
)
)
Output:
Hope this helps!!
If this solved your problem, please accept it as a solution and a kudos!!
Best Regards,
Shahariar Hafiz