Forum Discussion

v_mark's avatar
v_mark
Icon for Helper V rankHelper V
5 years ago
Solved

last 12 hours only

I have the table that looks like below.

out of 5, I should see only 3 as part of the last 12 hours (let's say its 9:07 CST AM now )


I'm planning to use it as a filter to show only the last 12 hours entries based on the current(now) time. 

so A B C will only show on the table/matrix. Need help

 

TicketCreatedDateTimeStatus
A5/6/2021 8:47New
B

5/6/2021 0:38

New
C

5/6/2021 0:34

New
D

5/5/2021 3:37

New
E

5/5/2021 0:04

New



  • Hi, v_mark 

     

    IF you want to work for the last 3 or 6 hours, You can change the number of Measure, if it's 3 hours, it's 3/24, if it's 6 hours, it's 6/24. as follows:

    Flag = IF(MAX([CreatedDateTime])<=NOW()&&MAX([CreatedDateTime])>=NOW()-3/24,1,0)

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

7 Replies

  • Hi v_mark ,

     

    You can try using "Relative time" option on your date slicer.

    After that select "Last" and enter 12 and then select "Hours".

     

    This will filter your data in the table visual. Also, if you don't want to use the slicer, you can use the same concept by dragging your "Date" field to Page Filters or Visual Filters and then select Relative Time from the options.

     

    Please mark it as solution and give kudos if it helps you.

     

    Thanks,

    Dheeraj

    • v_mark's avatar
      v_mark
      Icon for Helper V rankHelper V

      My issue right there is it follows are completely different timezone. I'm in CST, I was hoping to see a time 12 hours from my time. Let's say currently it's 10:53AM I should see something like

      10:53AM - 10:53PM 

    • v_mark's avatar
      v_mark
      Icon for Helper V rankHelper V

      Here's what it looks like in the pbi service. My current time is 11:12 AM 

       

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi v_mark  , 

     

    You could create a measure by the following formula:

    Flag = IF(MAX([CreatedDateTime])<=NOW()&&MAX([CreatedDateTime])>=NOW()-0.5,1,0)

    Then apply Flag measure to Filter:

    If you only want to see the top 3 records within 12 hours, you can add another filter:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • v_mark's avatar
      v_mark
      Icon for Helper V rankHelper V

      Will the same approach works for the last 3 or 6 hrs?

      • v-yalanwu-msft's avatar
        v-yalanwu-msft
        Icon for Community Support rankCommunity Support

        Hi, v_mark 

         

        IF you want to work for the last 3 or 6 hours, You can change the number of Measure, if it's 3 hours, it's 3/24, if it's 6 hours, it's 6/24. as follows:

        Flag = IF(MAX([CreatedDateTime])<=NOW()&&MAX([CreatedDateTime])>=NOW()-3/24,1,0)

        Best Regards,
        Community Support Team_ Yalan Wu
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.