Forum Discussion
DAX - Max time
Hi
I have a table containing the following columns. Date, Name and Time. See example table below. You will see that some names have multiple times on the same date.
I need to create a new column on this table that uses DAX to find the MAX Time for each person by date
| Date | Time | Name | Max Time - Expected result |
| 06/04/2021 | 11:08:37 | Anthony | |
| 06/04/2021 | 15:40:02 | Anthony | |
| 06/04/2021 | 17:19:52 | Anthony | 17:19:52 |
| 07/04/2021 | 17:17:54 | Anthony | 17:17:54 |
| 08/04/2021 | 10:21:58 | Anthony | 10:21:58 |
| 21/04/2021 | 20:30:00 | Bradley | 20:30:00 |
| 22/04/2021 | 18:30:00 | Bradley | |
| 22/04/2021 | 18:35:00 | Bradley | 18:35:00 |
| 26/04/2021 | 20:00:00 | Bradley | |
| 28/04/2021 | 20:00:00 | Bradley | |
| 28/04/2021 | 22:00:00 | Bradley | |
| 28/04/2021 | 23:59:59 | Bradley | 23:59:59 |
| 29/04/2021 | 21:00:00 | Bradley | 21:00:00 |
| 06/04/2021 | 10:09:51 | Ludo | |
| 06/04/2021 | 12:05:19 | Ludo | |
| 06/04/2021 | 13:03:15 | Ludo | |
| 06/04/2021 | 13:46:57 | Ludo | |
| 06/04/2021 | 16:17:16 | Ludo | 16:17:16 |
thank you
Richard
Hi, cottrera
Please check the below.
It is for creating a new column.
Max Time CC =VAR currentdate = 'Table'[Date]VAR currentanme = 'Table'[Name]RETURNIF (CALCULATE (MAX ( 'Table'[Time] ),FILTER ( 'Table', 'Table'[Date] = currentdate && 'Table'[Name] = currentanme )) = 'Table'[Time],'Table'[Time],BLANK ())Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
2 Replies
- Jihwan_KimSuper User
Hi, cottrera
Please check the below.
It is for creating a new column.
Max Time CC =VAR currentdate = 'Table'[Date]VAR currentanme = 'Table'[Name]RETURNIF (CALCULATE (MAX ( 'Table'[Time] ),FILTER ( 'Table', 'Table'[Date] = currentdate && 'Table'[Name] = currentanme )) = 'Table'[Time],'Table'[Time],BLANK ())Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
- cottreraPost Prodigy
Thank you again for your quick response. The DAX function did not work at first. This was due to the table being a direct query. When I converted it to import the dax worked fine. 😀