Forum Discussion
How can I match datetimes with dates?
Hello
I have this data:
| Col1 | Col2 | Col3 | Col4 |
| A | 01/01/2021 01:30 | 01/01/2021 | 1 |
| A | 01/01/2021 02:30 | 01/01/2021 | 1 |
| A | 01/01/2021 03:30 | 01/01/2021 | 1 |
| B | 01/01/2021 01:30 | 01/01/2021 | 2 |
| B | 01/01/2021 02:30 | 01/01/2021 | 2 |
| B | 01/01/2021 03:30 | 01/01/2021 | 2 |
I create a time graph using Col2 but I want to use in a Measure the Col4 where the date of Col2 = Col3. The think is that if I do that, it returns a whole column of three values from Col4 so I either need the max/avg of them or only the first value.
Any idea how to do that?
Thanks!
- Anonymous4 years ago
Hi Anonymous ,
About matching datetimes with dates, you can do the following.
Column = IF(DATE(YEAR([Col2]),MONTH([Col2]),DAY([Col2]))=[Col3],"Y","N")Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AllisonKennedy
Community Champion
Anonymous Yes, it must aggregate somehow so not sure exactly what your requirement is? Can you describe or draw your desired result further?
- AnonymousNot applicable
Hi Anonymous ,
About matching datetimes with dates, you can do the following.
Column = IF(DATE(YEAR([Col2]),MONTH([Col2]),DAY([Col2]))=[Col3],"Y","N")Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.