Forum Discussion
blazko
8 years agoHelper III
calculating previous time value
Hi. I'm having a problem calulating a column with previous record time. My table is : date, user, time. I need to put nwe column with like one step backward action. So when a cartain user has acti...
- Anonymous8 years ago
This should do it:
Previous Time = VAR CurrentTime = Table1[Time] VAR CurrentUser = Table1[User] VAR CurrentDate = Table1[Date] RETURN CALCULATE ( MAX ( Table1[Time] ), FILTER ( ALL ( Table1 ), Table1[Time] < CurrentTime && Table1[User] = CurrentUser && Table1[Date] = CurrentDate ) )Note that the column will show a blank value if it is the first time for a given date.
Anonymous
8 years agoNot applicable
This should do it:
Previous Time =
VAR CurrentTime = Table1[Time]
VAR CurrentUser = Table1[User]
VAR CurrentDate = Table1[Date]
RETURN
CALCULATE (
MAX ( Table1[Time] ),
FILTER (
ALL ( Table1 ),
Table1[Time] < CurrentTime
&& Table1[User] = CurrentUser
&& Table1[Date] = CurrentDate
)
)
Note that the column will show a blank value if it is the first time for a given date.
blazko
8 years agoHelper III
Thanks :-)