Forum Discussion
Running rowcount with filter by date
- 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
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
Wow, thank you. The second one did it!!!!! (although my laptop is burning now 😄 )