Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Filter Start Time

Hello,   Need some help with my new project. I'm still learning on how to code, and i got stucked on the following. Below is my table.   Time Stamp Hour # of Cases 11/11/19 7:04 AM 7 1...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi @pamboys09 ,

     

    Please check following steps as below:

    1. Create calculated table as slicer:

    Table 2 = CALENDARAUTO()

    2. Create measure:

    Measure =

    VAR td =

        FORMAT ( SELECTEDVALUE ( 'Table 2'[Date] ), "YYYYMMDD" ) & 20

    VAR pd =

        FORMAT ( PREVIOUSDAY ( 'Table 2'[Date] ), "YYYYMMDD" ) & 21

    RETURN

        CALCULATE (

            SUM ( 'Table'[# of Cases] ),

            FILTER (

                'Table',

                FORMAT ( 'Table'[Time Stamp], "YYYYMMDDHH" ) >= pd

                    && FORMAT ( 'Table'[Time Stamp], "YYYYMMDDHH" ) <= td

            )

        )

    3. Result would be shown as below:

    BTW, Pbix as attached, hopefully works for you.

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.