Select Max entry by user

I need to get the latest Check In by user. My current idea is user table virtual column [Last Check In ID] and then filter a slice by the user table. Any different methods for grabbing MAX entry grouped by X?

Solved Solved
0 1 263
1 ACCEPTED SOLUTION

Hello Austin,

If I understand the question correct, I think combine the MAX() with SELECT() function could solve the problem.

Say you have one column UserId and another column CheckInTime, then every time a user check in you append a new row, the table could look like below.


UserId CheckInTime
a@g.com 1970-01-01
b@g.com 1970-01-01
a@g.com 1970-01-03


then the expression could be:

MAX(
SELECT(
TableName[CheckInTime],
([USER]=โ€œuserId say a@g.com or refโ€,
false)
)
)

View solution in original post

1 REPLY 1

Hello Austin,

If I understand the question correct, I think combine the MAX() with SELECT() function could solve the problem.

Say you have one column UserId and another column CheckInTime, then every time a user check in you append a new row, the table could look like below.


UserId CheckInTime
a@g.com 1970-01-01
b@g.com 1970-01-01
a@g.com 1970-01-03


then the expression could be:

MAX(
SELECT(
TableName[CheckInTime],
([USER]=โ€œuserId say a@g.com or refโ€,
false)
)
)

Top Labels in this Space