Forum Discussion
Calculate difference in minutes
are you copying and pasting correctly?
TimeDiff = var _PreviousTime = CALCULATE(MAX(DataView[CommTimeStamp]), FILTER(DataView, EARLIER(DataView[CommTimeStamp]) > DataView[CommTimeStamp])) return IF(ISBLANK(_PreviousTime), 0, DATEDIFF(_PreviousTime, DataView[CommTimeStamp], MINUTE))
yes here u can see still error
- hnguy717 years ago
Super User
I see that you still have a comma right before the DATEDIFF function. Also, double check to see if your CommTimeStamp column is indeed Data Type of DATE/TIME
- Anonymous7 years agoNot applicable
the column are DATE/TIME already. I paste same code u wrote. but i works for u?
- hnguy717 years ago
Super User
Anonymous
It definitely does.
- Anonymous7 years agoNot applicable
It's because u have another date format? also american? because I have 2019-04-19 13:33:22
- hnguy717 years ago
Super User
it shouldn't matter. My original source for the date is exactly the same as yours. I'll upload the sample file for you to view:
https://1drv.ms/u/s!An8CCFsOzw0uc_OWSjBbUOCOgPk - Anonymous7 years agoNot applicable
now it works after small changes, thanks but is that possible that it gonna only filter from 10 May and after? where in the code can I write it and how? because the data are huge and it's says ,
There's not enough memory to complete this operation. Please try again later when there may be more memory available.
- hnguy717 years ago
Super User
If you're importing your data, you can filter from May 10th onwards. If you're using LiveConnection or from a database you can specify the filter ie,
SELECT * FROM db.MyDatabase WHERE CommTimeStamp >= '10/05/2019'
- Anonymous7 years agoNot applicable
Can I use another instead for EARLIER? because it's earler that cause this memory problem. or do you have anyother soulation?