Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How can I match datetimes with dates?

Hello

 

I have this data:

 

Col1Col2Col3Col4
A01/01/2021 01:3001/01/20211
A01/01/2021 02:3001/01/20211
A01/01/2021 03:3001/01/20211
B01/01/2021 01:3001/01/20212
B01/01/2021 02:3001/01/20212
B01/01/2021 03:3001/01/20212

 

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!

  • Anonymous's avatar
    Anonymous
    4 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's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion

    Anonymous  Yes, it must aggregate somehow so not sure exactly what your requirement is? Can you describe or draw your desired result further?

  • Anonymous's avatar
    Anonymous
    Not 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.