Forum Discussion
Anonymous
6 years agoNot applicable
Splitting table rows from value
Hello, I need to calculate the duration between Events for each particular user working in a specific file in a datasource that contains info from multiple users. Sample table below. The goal...
- 6 years ago
Try
DateDiff = 'view-activated collected'[DateTime] - MINX(FILTER('view-activated collected', 'view-activated collected'[DocPath] = EARLIER('view-activated collected'[DocPath]) && 'view-activated collected'[Username] = EARLIER('view-activated collected'[Username]) && 'view-activated collected'[DateTime] > EARLIER('view-activated collected'[DateTime]) ),'view-activated collected'[DateTime])
Anonymous
6 years agoNot applicable
thank you for such quick reply ,
I am getting an error of type
"Too few arguments were passed to the MINX function. The minimum argument count for the function is 2."
the actual formula I am using is this
DateDiff = 'view-activated collected'[DateTime] = MINX(FILTER('view-activated collected','view-activated collected'[DocPath] = EARLIER('view-activated collected'[DocPath] && 'view-activated collected'[Username] = EARLIER('view-activated collected'[Username]) && ('view-activated collected'[DateTime] > EARLIER('view-activated collected'[DateTime])),'view-activated collected'[DateTime])))
amitchandak
6 years agoSuper User
Try
DateDiff = 'view-activated collected'[DateTime] - MINX(FILTER('view-activated collected',
'view-activated collected'[DocPath] = EARLIER('view-activated collected'[DocPath])
&& 'view-activated collected'[Username] = EARLIER('view-activated collected'[Username])
&& 'view-activated collected'[DateTime] > EARLIER('view-activated collected'[DateTime])
),'view-activated collected'[DateTime])- Anonymous6 years agoNot applicable
It is working very well, thank you.
Found an unintended consequence of the requirement, though.
Can the last DateDiff calculation for the last entry for user+docpath be set to 0?