Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Timestamp Column

How can I pull out data from below column that will show requests before thursday @ 3:30pm and after ending on Sunday.

Hope I explained that right?

 

 

 

Timestamp
2018-10-10 12:40:27
2018-10-10 12:41:22
2018-10-16 9:19:59
2018-10-19 7:10:55
2018-10-27 6:35:41
2018-10-19 22:47:48
2018-10-27 6:35:46
2018-10-27 9:35:46
2018-10-23 12:09:15
2018-10-23 12:15:15
2018-10-24 11:09:15
2018-10-26 11:10:15
2018-10-26 13:09:15
2018-10-26 16:29:15
2018-10-23 9:29:43
2018-10-23 9:31:30
2018-10-23 9:31:39
2018-10-23 9:32:16
2018-10-23 9:33:09
2018-10-23 9:33:27
2018-10-23 9:33:48
2018-10-23 12:09:15
2018-10-24 13:31:49
2018-10-23 12:21:16
2018-10-24 8:55:45
2018-10-27 6:33:49
  • Hi Anonymous

     

    You could create a new table:

     

    NewTable =
    FILTER (
        Table1;
        Table1[Timestamp] >= DATE ( Year1; Month1; Day1 ) + TIME ( Hour1; Month1; Second1 )
        && 
    Table1[Timestamp] <= DATE ( Year2; Month2; Day2 ) + TIME ( Hour2; Month2; Second2 ) )

    where Table1 is your current table and Year1, Month1, etc  and Year2, Month2, etc. are the initial and final date/time within which you want to keep dates (your Thursday and Sunday in your example), 

7 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous

     

    You could create a new table:

     

    NewTable =
    FILTER (
        Table1;
        Table1[Timestamp] >= DATE ( Year1; Month1; Day1 ) + TIME ( Hour1; Month1; Second1 )
        && 
    Table1[Timestamp] <= DATE ( Year2; Month2; Day2 ) + TIME ( Hour2; Month2; Second2 ) )

    where Table1 is your current table and Year1, Month1, etc  and Year2, Month2, etc. are the initial and final date/time within which you want to keep dates (your Thursday and Sunday in your example), 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Syntax error

    • Anonymous's avatar
      Anonymous
      Not applicable

      Syntax error was for new table.

  • Anonymous

     

    I create a new column to find the values in the scope or out of scope. I am not sure if this is what you want.

     

     

     

    Column = 
    VAR day = WEEKDAY(Sheet2[Timestamp],1)
    VAR time=TIMEVALUE(Sheet2[Timestamp])
    return if((day=5&&time>=TIME(15,00,00))||day=6||day=7,"No","Yes")

    Thanks and BR

    Ryan

    • Anonymous's avatar
      Anonymous
      Not applicable

      OK I create a custom column, I get an error.

      • ryan_mayu's avatar
        ryan_mayu
        Super User

        Anonymous

         

        Not in the edit queries. That is for M. You need to create a column in the modeling. That is for DAX.