cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
v_mark
Helper III
Helper III

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



1 ACCEPTED SOLUTION

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)

v-yalanwu-msft_2-1620887749522.png

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.

View solution in original post

7 REPLIES 7
v-yalanwu-msft
Community Support
Community 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:

v-yalanwu-msft_0-1620728180854.png

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

v-yalanwu-msft_1-1620728180856.jpeg

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.

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

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)

v-yalanwu-msft_2-1620887749522.png

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.

View solution in original post

dkaushik
Resolver II
Resolver II

Can you share a screen capture of what it looks like when you apply this filter? Also, check what it looks in pbi service when you publish it. If its showing different like mentioned in this post 
Solved: Date calculating differently on desktop and web du... - Microsoft Power BI Community

then you will need to convert it to specific timezone first (CST in your case) and then apply a filter on it.

 

Regards,

Dheeraj

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

v_mark_0-1620663141758.png

 

dkaushik
Resolver II
Resolver II

Hi @v_mark ,

 

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

dkaushik_0-1620660864027.png

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

dkaushik_1-1620661029157.png

 

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

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 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors