Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
igrandey89
Advocate II
Advocate II

DAX Measure "Time To Resolve" - How to replace negative values with 0.

Hello all,

 

I've created a measure for "Escalated Issues Resolution Time" - Some background: I'm creating a report which displays items and the days we take to resolve "normal" issues and "escalated" issues.

 

However, we've found some tickets/issues in which the escalation date listed is *after* the resolution date of said issue. There are only a handful of results that present a negative number of days--however, I'm attempting to replace these negative numbers with 0's (or even blanks would do).

Currently, my DAX for this: 

Escalated Resolution Time = IF (
ISBLANK ( [Resolved Day]),
0,
( [Resolved Day] - [Escalation Day] )*1)

I've attempted to search everywhere, to make this change work--and the only result that was close to what I need:
-Adding ABS in front of "([Resolved Day] - [Escalation Day])*1)"
-However, this only changes the values to positive as you most likely know. Which effects the scoring metric we've created, that includes this measure.

 

Does anyone know how I might complete this change, if possible?

1 ACCEPTED SOLUTION

Thank you for the response!
I attempted this, and it was still giving me issues--However, I was able to resolve the issue by creating a column:

_Escalated_TTR = DATEDIFF ([_esclation_Date], [_Resolved_day], DAY)
Then adjusted my measure like-so:
Escalated Resolution Time = IF([_Escalated TTR] <=0, 0, [_Escalated TTR])
This seems to have resolved my problem!

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

How about this?

 

Escalated Resolution Time =
VAR DayR = [Resolved Day]
VAR DayE = [Escalation Day]
RETURN
    IF ( ISBLANK ( DayR ) || DayR < DayE, 0, ( DayR - DayE ) * 1 )

 

Thank you for the response!
I attempted this, and it was still giving me issues--However, I was able to resolve the issue by creating a column:

_Escalated_TTR = DATEDIFF ([_esclation_Date], [_Resolved_day], DAY)
Then adjusted my measure like-so:
Escalated Resolution Time = IF([_Escalated TTR] <=0, 0, [_Escalated TTR])
This seems to have resolved my problem!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.