Forum Discussion

Kolumam's avatar
Kolumam
Icon for Post Prodigy rankPost Prodigy
7 years ago
Solved

How to filter timestamp using a calculated column or measure?

Hi All, 

 

I need to filter the timestamp to show only between 6 AM and 8 PM. Please let me know how I can achieve this.

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Kolumam 

    Create another column to calculate the time.

    Hour = HOUR(<datetime>)  

    Then filter according to this new column. Use the built in filtering mechanism.

    6 >= Hour >= 20

     

    Cheers!
    A

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Kolumam 

    Create another column to calculate the time.

    Hour = HOUR(<datetime>)  

    Then filter according to this new column. Use the built in filtering mechanism.

    6 >= Hour >= 20

     

    Cheers!
    A

  • Hello Kolumam 

    You could do it with a measure like this.

    Amount Filtered = 
    CALCULATE(
        SUM ( 'Table'[Amount] ),
        FILTER ( 
            'Table',
            'Table'[Time] >= TIME(6,0,0) &&
            'Table'[Time] <= TIME (20,0,0)
        )
    )

    Then put that measure in your chart.