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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors