cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Resolver I

## I need to track tickets that will due within the next 5 hours

Hi All,

Anyone knows how can I track tickets that will due within the next 5 hours? Is there any formula for that?

I have available columns "Ticket number" and "Due Date". I need to have a new column for tickets that will due within the next 5 hours.

Below is an example

 Ticket Number Due Date will due within the next 5 hours? ABC123 12/12/2022 11:50 PM Yes ABC456 12/13/2022 12:00 AM Yes XYZ123 12/13/2022 7:00 AM No XYZ456 12/13/2022 9:00 AM No
1 ACCEPTED SOLUTION
Super User

@Newbie22 Maybe:

``````Measure =
VAR __DueBy = NOW() + 5/24
VAR __DateTime = MAX('Table'[Due Date])
VAR __Result = IF(__DateTime <= __DueBy,"Yes","No")
RETURN
__Result``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
2 REPLIES 2
Resident Rockstar

Base Data

formula ( I used 8 hours sicnce at my place it was 16:52

``````next 5 Hours =
var var_TimeOfLineItem = SELECTEDVALUE(Tickets[Due Date])
var var_TimeNow = NOW()
var var_DeltainHours = (var_TimeOfLineItem-var_TimeNow) * 24
var var_DeltaInHoursallowed = 8

RETURN
IF(var_DeltainHours >= 0 && var_DeltainHours <= var_DeltaInHoursallowed,1,0)``````

result

can also use it as a filter

Best regards

Michael

-----------------------------------------------------

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

-----------------------------------------------------

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Super User

@Newbie22 Maybe:

``````Measure =
VAR __DueBy = NOW() + 5/24
VAR __DateTime = MAX('Table'[Due Date])
VAR __Result = IF(__DateTime <= __DueBy,"Yes","No")
RETURN
__Result``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors