Forum Discussion
Anonymous
3 years agoNot applicable
Time between two dates based on criteria
Hello! I have a table of ticket data where I for each critical ticket need to calculate the time since the last critical ticket was registered. Been trying to solve this for a few hours now withou...
FreemanZ
Super User
3 years agoHi Jowh,
Not sure about your use case, is it something like below:
here comes the code for the calculated column:
Duration =
VAR CurrentDate = 'Table'[Date]
VAR TABLE1 =
CALCULATETABLE(
'TABLE',
FILTER ('Table', 'Table'[Priority]="Yes"),
FILTER ('Table', 'Table'[Date]>CurrentDate)
)
VAR MinDate =
MINX (
TABLE1,
'Table'[Date]-CurrentDate)
RETURN
IF (
'Table'[Priority]="Yes",
INT( MinDate)
)